Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Score = db.collection('Score')
- app.get('/', async (req, res) => {
- const result = await Score.aggregate([
- { $sort: {score: -1}},
- { $limit: 10}
- ])
- console.log("get")
- res.status(200)
- .send(result)
- })
- app.post('/', async (req, res) => {
- const result = await Score.insert(req.body)
- console.log("Post")
- res.status(200).send(result)
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement