{_id: STRING
outputs: [
{:foo INTEGER, :index INTEGER, :bar STRING}
…more subdocuments with same structure..
]}
db.collection.ensureIndex({"_id": 1,"outputs.index":1})outputs = (load outputs from some other resource)
for each output
db.collection.update({"_id": output.STRING_ID, "outputs.index": output.INTEGER_INDEX},
{$set: {"outputs.$.foo": output.INTEGER_FOO}})This is SERVER-8192.
It's a good idea to avoid indexed huge arrays, especially in cases when you expect to be updating the values.
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/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...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/bb214adc-3876-4853-9304-518cd90d1272%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello Asya,Thank you for your reply.Is there a work around for this? or the only option is to put the array in a separate collection?
Ryan
On Saturday, April 19, 2014 9:43:17 AM UTC+3, Asya Kamsky wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/bb214adc-3876-4853-9304-518cd90d1272%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/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...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/c8145a6f-1dee-43f9-ab70-334098230f27%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/613507e7-8fe9-4652-aa4a-0aaab05e6d5c%40googlegroups.com.