Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get data from mongodb node js using mongoose

Athlete.
  find().
  where('sport').equals('Tennis').
  where('age').gt(17).lt(50).  //Additional where query
  limit(5).
  sort({ age: -1 }).
  select('name age').
  exec(callback); // where callback is the name of our callback function.
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #data #mongodb #node #js #mongoose
ADD COMMENT
Topic
Name
6+7 =