I've got collection of items,
[
{
itemId: 1249,
someField: 'abc'
},
{
itemId: 1479,
anotherField: 'bcc'
}
,
// etc
]
I recieve another portion of data. Some of the items could already be there, some not,
[
{
itemId: 6534,
someField: 'trw'
},
// already stored in collection..
{
itemId: 1249,
someField: 'abc'
}
]
I'm looking for the way of bulk insert of this data with upsert strategy (means, if item with such itemId is already there - update, otherwise insert).
Is that possible to do with only one query, of I need to go throught collection manually and upsert each item?