Yes, I've done something similar with dynamically building paths for mongoDB so I was confident that key string could be made.

However, I haven't done many updates on nested arrays, its a shame you have to pre-calculate those positions, I see requests for an improvement to that on their forums but I don't think its done just yet: https://jira.mongodb.org/browse/SERVER-831

Glad you got some progress.

Jamie MacDonald.



On 18/12/2013 17:55, Rick wrote:
Thanks Jamie,

It seems that I got it working from just making the whole area a string:

var setTarget = '{$set:{"chapters.#dbVars.targetArrayChapterPos-1#.sections.$.chSort" : #newSortNum#}}';

var objUpdateSectionSortNum = MongoCollectionUpdate( db, "book",
{ "_id" : MongoObjectid( arguments.bookId ), "chapters.sections.chapterId": arguments.chapterId }, setTarget);

Still doing more testing.  I will try your method as well.


--
--
online documentation: http://openbd.org/manual/
http://groups.google.com/group/openbd?hl=en

---
You received this message because you are subscribed to the Google Groups "Open BlueDragon" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


--
aw2.0
  http://www.aw20.co.uk/

--
--
online documentation: http://openbd.org/manual/
http://groups.google.com/group/openbd?hl=en

--- You received this message because you are subscribed to the Google Groups "Open BlueDragon" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to