Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

order by mongodb

db.people.find( { status: "A" } ).sort( { user_id: 1 } )
db.people.find( { status: "A" } ).sort( { user_id: -1 } )

-- sql
SELECT *
FROM people
WHERE status = "A"
ORDER BY user_id ASC

SELECT *
FROM people
WHERE status = "A"
ORDER BY user_id DESC
Source by www.mongodb.com #
 
PREVIOUS NEXT
Tagged: #order #mongodb
ADD COMMENT
Topic
Name
3+2 =