-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
ALL
this.service.db.collection(this.config.mongodb.collections.campaigns) .findOneAndUpdate({ 'metadata.campaign_id': '123' }, { $set: { 'status.type.0.documentOne': { in_sync: true }, 'status.type.0.documentTwo': { in_sync: false } } } );
The above code will create `status.type` as an `Object`, whereas this command when run in a shell:
db.getCollection('campaigns').findOneAndUpdate({ 'metadata.campaign_id': '123' }, $set: { 'status.type.0.documentOne': { in_sync: true }, 'status.type.0.documentTwo': { in_sync: false }})
Will create `status.type` as an Array.
db.isMaster() results:
{ "ismaster" : true, "maxBsonObjectSize" : 16777216, "maxMessageSizeBytes" : 48000000, "maxWriteBatchSize" : 100000, "localTime" : ISODate("2019-11-25T22:15:38.241Z"), "logicalSessionTimeoutMinutes" : 30, "connectionId" : 405472, "minWireVersion" : 0, "maxWireVersion" : 8, "readOnly" : false, "ok" : 1.0 }
- is related to
-
SERVER-27442 Positional path component in match language should not act as both an array index and a field name for a single document
- Backlog
-
SERVER-24748 Aggregation does not provide a way to access a specific element of an array
- Backlog