Hi Rick,
Like you say, you may have checked your variables already, but try the
code below to break down the steps, this may let you get more access to
what the update function is seeing.
// build update target filter
var updateTarget = {
"_id": mongoObjectId( arguments.bookId ),
"chapters.sections.chapterId": arguments.chapterId
};
// make your target key
var updateSetTarget =
"chapters.#dbVars.targetArrayChapterPos#.sections.#dbVars.targetArraySectionPos#.chSort";
// [DEBUG] may want to use console here to debug if this is set correctly
//consoleOutput(true);
//console(updateSetTarget);
var updateSet = { "$set": {} };
updateSet["$set"][updateSetTarget] = newSortSum;
// [DEBUG] again you could "writedump" here to check the entire update
structure
//writeDump(updateSet);
//abort;
// set the new sort number for existing section
var objUpdateSectionSortNum = MongoCollectionUpdate( db, "book",
updateTarget, updateSet );
Jamie MacDonald
On 18/12/2013 15:33, Rick wrote:
I understand how to use StructInsert() but could you provide an
example of how it would help to build the field text?
--
--
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.