1

I have following data structure in Nedb:

    ["UserId":"1446844665274","taskDone":"false","id":12,"_id":"1XURfx5uAZpgbh1i"]
    ["UserId":"1446844665274","taskDone":"false","id":10,"_id":"2I25xNAGTM7Iw2Af"]
    ["UserId":"1446844665274","taskDone":"false","id":3,"_id":"ESfi8ej5pbWBHV8o"]
    ["UserId":"1446844665274","taskDone":"false","id":9,"_id":"Etta7RLg2b09p9Bx"]

I am trying to filter for the row with minimum id value from the table. It will be really helpful if anybody can suggest how can i query NEDB to get the minimum id value? I am using node.js along with nedb.

Thankyou.

user3202499
  • 87
  • 2
  • 14

1 Answers1

2

Maybe you sort it with the id ascending and get the first with limit

db.find({}).sort({ id: 1 }).limit(1).exec(function (err, docs) {
});
Nina Scholz
  • 376,160
  • 25
  • 347
  • 392