I'm currently working with the Node.js MongoDB driver, and am faced with a structure that is as follows:
users (database)
users (collection)
{
name: bob,
data: [
{
name: mydata,
relations: [ ** I want to addToSet here! ** ]
},
{
name: mydata2,
relations: []
}
]
},
{
name: jeff,
data: [...same stuff...]
}
So, I have an array, that is within an object, that is within an array, and my aim to add an entry to it.
I realize that this looks like a relational thing that MongoDB is poorly suited for, but I am trying to accommodate some relational data that may be uploaded. Does anyone happen to know a way to do this? Not necessarily in one query, just in any way at all.