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: Thu, 21 Apr 2016 03:37:52 -0700 (PDT)
Why ads?
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/55377822-06ab-486a-9f1d-5a2817570bca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Why ads?