[SERVER-20862] About upsert can't create a array with $ positional operator. Created: 10/Oct/15  Updated: 10/Oct/15  Resolved: 10/Oct/15

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: justinliao Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

I try to update a minutes array(this array is not exist) with upsert & $ positional operator. I need it automatic create a minutes array, but created a minutes object.



 Comments   
Comment by Stennie Steneker (Inactive) [ 10/Oct/15 ]

Hi,

The SERVER project is for reporting bugs or feature suggestions for the MongoDB server.

For MongoDB-related community support discussion please post on the mongodb-user group or Stack Overflow.

Thanks,
Stephen

Comment by justinliao [ 10/Oct/15 ]

For example:
my schema is like that:
day: { }
minutes: [
details: [

{ name: ' ', age: 22 }

, .....
]
summary: { }
]

If the minutes is not exist. and I upsert a new minute into minutes with $ positional operator. It May create a minutes object, and $ positional operator will be flied name.
Just Like this:

day: { }
minutes: {
$: {
details: [

{ name: ' ', age: 22 }

, .....
]
summary: { }
}
}

Have any solution to solve it?

Generated at Thu Feb 08 03:55:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.