Skip to content

Commit b1c61a9

Browse files
nbbeekenmbroadst
authored andcommitted
docs(examples): correct replaceOne usage
Use the correct parameters to the replaceOne example usage NODE-2502
1 parent 0984316 commit b1c61a9

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

test/examples/update_documents.js

+5-13
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,11 @@ describe('examples(update-documents):', function() {
154154
await db.collection('inventory').replaceOne(
155155
{ item: 'paper' },
156156
{
157-
$set: {
158-
item: 'paper',
159-
instock: [
160-
{ warehouse: 'A', qty: 60 },
161-
{ warehouse: 'B', qty: 40 }
162-
]
163-
},
164-
$unset: {
165-
qty: '',
166-
size: '',
167-
status: '',
168-
lastModified: ''
169-
}
157+
item: 'paper',
158+
instock: [
159+
{ warehouse: 'A', qty: 60 },
160+
{ warehouse: 'B', qty: 40 }
161+
]
170162
}
171163
);
172164
// End Example 54

test/functional/document_validation.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ describe('Document Validation', function() {
124124
// updateMany
125125
col.replaceOne(
126126
{ e: 1 },
127-
{ $set: { e: 1 } },
127+
{ e: 1 },
128128
{ upsert: true, bypassDocumentValidation: true },
129129
function(err) {
130130
test.equal(null, err);

0 commit comments

Comments
 (0)