lowdb icon indicating copy to clipboard operation
lowdb copied to clipboard

Push only if there're new data

Open fmigliorato opened this issue 7 years ago • 2 comments

I need to get data from an api, then save to lowdb but only if there're new data. Is it possible? Thanks in advance

fmigliorato avatar Jan 13 '19 11:01 fmigliorato

I solved this problem by doing following example

if (db.get('users').find({ key : value }).value() == undefined){
     //code
}

sanket29395 avatar Feb 06 '19 10:02 sanket29395

Hey @sanket29395 thanks! Really appreciated

fmigliorato avatar Feb 06 '19 10:02 fmigliorato