-
-
Notifications
You must be signed in to change notification settings - Fork 101
Closed
Description
The result always be null from this code:
Map<String, dynamic> data = await mongodb.dbCollection.findAndModify(
update: [
{'field A': 'data A'},
{'field B': 'data B'},
],
query: where.id(ObjectId.parse('Object Id')),
returnNew: true,
);
but it works with this code. But I don't want to replace the document:
Map<String, dynamic> data = await mongodb.dbCollection.findAndModify(
update: {'field A': 'data A', 'field B': 'data B'},
query: where.id(ObjectId.parse('Object Id')),
returnNew: true,
);
I get an error Exception: Not implemented for ModifierBuilder({$set: {field A: data A}})
When I try using modify.set like this:
Map<String, dynamic> data = await mongodb.dbCollection.findAndModify(
update: [
modify.set('field A', 'data A'),
modify.set('field B', 'data B'),
],
query: where.id(ObjectId.parse('Object Id')),
returnNew: true,
);
What do I mistake?
Metadata
Metadata
Assignees
Labels
No labels