Skip to content

Instantly share code, notes, and snippets.

@imchao9
Created February 16, 2016 15:37
Show Gist options
  • Save imchao9/073a0f37db81ebf25e02 to your computer and use it in GitHub Desktop.
Save imchao9/073a0f37db81ebf25e02 to your computer and use it in GitHub Desktop.
MongoDB 查询语句 and写法
var startTime = Date.parse(new Date("2016 02-01"))/1000;
var endTime = Date.parse(new Date("2016 02-16"))/1000;
db.getCollection('sqllogs').find(
{$and:[{"create_time":{$lt:endTime}},{"create_time":{$gt:startTime}},
{"content":/update.*praise_times.*35167.*/i}]}).sort({"create_time":1})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment