Skip to content

Instantly share code, notes, and snippets.

@conanak99

conanak99/log.js

Created Aug 20, 2017
Embed
What would you like to do?
app.get('/log', function(request, response) {
// Tìm những log trong database có userId trùng với id trong cookie
// Sắp xếp theo thứ tự thời gian
db.log.find({ userId: request.cookies.id }).sort( {time: -1} , (err, docs) => {
response.json({ id: userId, logs: docs });
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment