R
R
Rocket-API
Search…
MongoDb专区
语法为标准的mongodb command语法,见: https://docs.mongodb.com/manual/reference/command/
新增
1
str = """
2
{
3
"insert":"book",
4
"documents":[
5
{
6
"name":"富贵",
7
"price":38.8
8
}]
9
}
10
"""
11
return db.insert(str)
Copied!
列表查询
1
sql = """
2
{
3
"find":"book",
4
"filter":{
5
"name":#{name}
6
}
7
}
8
"""
9
return db.find(sql);
Copied!
单条查询
1
sql = """
2
{
3
"find":"book",
4
"filter":{
5
"name":#{name}
6
}
7
}
8
"""
9
return db.findOne(sql);
Copied!
计数查询
1
count = """
2
{
3
count: "book",
4
query: {
5
"name":#{name}
6
}
7
}
8
"""
9
return db.findOne(sql);
Copied!
分页查询
1
sql = """
2
{
3
"find":"book",
4
"filter":{
5
"name":#{name}
6
}
7
}
8
"""
9
return db.pager(sql);
Copied!
Last modified 1yr ago
Copy link