Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ describe('Causal Consistency - prose tests', function () {
let firstOperationTime;
return db
.collection('causal_test')
.insert({}, { session: session })
.insertOne({}, { session: session })
.then(() => {
firstOperationTime = test.commands.succeeded[0].reply.operationTime;
return db.collection('causal_test').findOne({}, { session: session });
Expand Down
16 changes: 0 additions & 16 deletions test/integration/crud/bulk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1376,22 +1376,6 @@ describe('Bulk', function () {
expect(error).to.have.property('message', 'Invalid BulkOperation, Batch cannot be empty');
});

// TODO(NODE-7219): remove outdated test
// it('should return an error instead of throwing when an empty bulk operation is submitted (with promise)', function () {
// return client
// .db()
// .collection('doesnt_matter')
// .insertMany([])
//
// .then(function () {
// test.equal(false, true); // this should not happen!
// })
// .catch(function (err) {
// expect(err).to.be.instanceOf(MongoDriverError);
// expect(err).to.have.property('message', 'Invalid BulkOperation, Batch cannot be empty');
// });
// });

it('should properly account for array key size in bulk unordered inserts', async function () {
const documents = new Array(20000).fill('').map(() => ({
arr: new Array(19).fill('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
Expand Down
57 changes: 0 additions & 57 deletions test/integration/crud/crud_api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,35 +315,6 @@ describe('CRUD API', function () {
await db.collection('t1').drop();
});

// TODO(NODE-7219): Remove test as it doesn't test correct aggregation execution
// it('allMethods', async function () {
// const cursor = db.collection('t1').aggregate([{ $match: {} }], {
// allowDiskUse: true,
// batchSize: 2,
// maxTimeMS: 50
// });
//
// // Exercise all the options
// cursor
// .geoNear({ geo: 1 })
// .group({ group: 1 })
// .limit(10)
// .match({ match: 1 })
// .maxTimeMS(10)
// .out('collection')
// .project({ project: 1 })
// .redact({ redact: 1 })
// .skip(1)
// .sort({ sort: 1 })
// .batchSize(10)
// .unwind('name');
//
// // Execute the command with all steps defined
// // will fail
// const err = await cursor.toArray().catch(err => err);
// expect(err).to.be.instanceof(MongoServerError);
// });

it('#toArray()', async function () {
const cursor = db.collection('t1').aggregate();
cursor.match({ a: 1 });
Expand Down Expand Up @@ -477,15 +448,6 @@ describe('CRUD API', function () {
});

describe('should correctly execute update methods using crud api', function () {
// TODO(NODE-7219): Remove test. There is no `update` method anymore
// it('legacy update', async function () {
// const db = client.db();
// const r = await db
// .collection('t3_1')
// .update({ a: 1 }, { $set: { a: 2 } }, { upsert: true });
// expect(r).property('upsertedCount').to.equal(1);
// });

it('#updateOne()', async function () {
const db = client.db();
const i = await db.collection('t3_2').insertMany([{ c: 1 }], { writeConcern: { w: 1 } });
Expand Down Expand Up @@ -805,25 +767,6 @@ describe('CRUD API', function () {
test.ok(r != null);
});

// TODO(NODE-7219): Remove test as it duplicates the one from the above
// it('should correctly execute crud operations using w:0', {
// metadata: {
// requires: { topology: ['single', 'replicaset', 'sharded'] }
// },
//
// test: async function () {
// const db = client.db();
//
// const collection = db.collection<{ _id: number }>('w0crudoperations');
// const r = await collection.updateOne(
// { _id: 1 },
// { $set: { x: 1 } },
// { upsert: true, writeConcern: { w: 0 } }
// );
// test.ok(r != null);
// }
// });

describe('when performing a multi-batch unordered bulk write that has a duplicate key', function () {
it('throws a MongoBulkWriteError indicating the duplicate key document failed', async function () {
const ops = [];
Expand Down
Loading