.set()
Sets a new value to the value of the provided key.
set(key, value, encrypt)
Returns
Description
Any
The updated data from the provided key's root
db.set('user', { name: 'Peter' }); // { name: 'Peter' }
db.get('user'); // { name: 'Peter' }
Also allows the use of dot notation:
db.get('user'); // { name: 'Peter' }
db.set('user.age', 19); // { name: 'Peter', age: 19 }
Last updated
Was this helpful?