Im using Mongodb with Mongoskin. I have the following data structure:
clients: {
firstArray: [
{
_id: '153'.
someField1: 'someVal1',
someField2: 'someVal2'
}
...
]
secondArray: [
{
_id: '7423'.
someField1: 'someVal1',
someField2: 'someVal2',
firstArrayIds: ['153, 154, 155, ...']
}
...
]
}
Is it somehow possible to $push
a object to firstArray
, and in the same query add the _id
to secondArray.firstArraysIds
¨?