The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/threads/client/upsert.js

10 lines
281 B

export const upsert = (Collection, objects) => {
const { queries } = Collection;
Collection.queries = [];
objects.forEach(({ _id, ...obj }, index) => {
if (index === obj.length - 1) {
Collection.queries = queries;
}
Collection.upsert({ _id }, { _id, ...obj });
});
};