漂泊雪狼的博客

思考,讨论,分享C#,JavaScript,.NET,Oracle,SQL Server……技术

导航

MongoDB 多条件组合查询

Posted on 2015-06-08 14:17  漂泊雪狼  阅读(3592)  评论(0)    收藏  举报

组合条件查询json格式语法

{
    "$and": [
        {
            "Date": {
                $gt: ISODate("2015-06-05T00:45:00.00"),
                $lt: ISODate("2015-06-05T00:50:00.00")
            }
        },
        {
            "ObjID": 406
        }
    ]
}

 

mongodb数据导入导出

F:\mongodb\bin>mongoexport  --query  {"ObjID":411}  -d gps_current -c gps  -o 1.
txt --port 27017 --host localhost
connected to: localhost:27017
exported 9091 records
D:\Winservice\mongodb>mongoimport --host localhost --port 27017 --db gps_current_lhua -c gps --file 1.txt
connected to: localhost:27017
2016-06-13T13:20:52.267+0800 check 9 9131
2016-06-13T13:20:52.275+0800 imported 9131 objects