Re: Is array index position in MongoDB document guaranteed to be maintained for operations?

From: Mayank Jain <firesofmay@xxxxxxxxx>
To: mongodb-user <mongodb-user@xxxxxxxxxxxxxxxx>
Date: Sun, 24 Apr 2016 10:34:46 -0700 (PDT)
Why ads?
Any updates?

On Thursday, April 21, 2016 at 4:07:52 PM UTC+5:30, Mayank Jain wrote:

Hi,

I checked the MongoDB docs but couldn't find the answer to this question.
Is the array index position guaranteed to remain same if you only do $push 
operations on it?

Example query
db.example.findAndModify({query: { name: "test"},
                         update: { $push: { "mapping.s": "free" }},
                         upsert: true,
                         new: true})


Can the application use the index of the array reliably in this case when 
fetching the whole doc based on its name?

I am using MongoDB 3.2.x version

Thanks.


-- 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
--- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/53d579f0-2808-416c-8297-dd44bc94157a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Why ads?