mirror of
https://github.com/garraflavatra/rolens.git
synced 2024-12-01 13:20:54 +00:00
Reflect upsert in update code example
This commit is contained in:
parent
af72f76350
commit
f7c8f9b807
@ -46,10 +46,11 @@
|
||||
|
||||
let operation = '{ ' + form.parameters.filter(p => p.type).map(p => `${p.type}: ${p.value || '{}'}`).join(', ') + ' }';
|
||||
if (operation === '{ }') {
|
||||
operation = '';
|
||||
operation = '{}';
|
||||
}
|
||||
|
||||
const code = `db.${collection.key}.${method}(${form.query || '{}'}${operation ? ', ' + operation : ''});`;
|
||||
const options = form.upsert ? ', { upsert: true }' : '';
|
||||
const code = `db.${collection.key}.${method}(${form.query || '{}'}, ${operation}${options});`;
|
||||
return code;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user