File tree Expand file tree Collapse file tree 3 files changed +24
-14
lines changed
unified-test-format/valid-pass Expand file tree Collapse file tree 3 files changed +24
-14
lines changed Original file line number Diff line number Diff line change @@ -740,10 +740,10 @@ def command(
740
740
741
741
>>> db.command("buildinfo")
742
742
743
- For a command where the value matters, like ``{collstats :
743
+ For a command where the value matters, like ``{count :
744
744
collection_name}`` we can do:
745
745
746
- >>> db.command("collstats ", collection_name)
746
+ >>> db.command("count ", collection_name)
747
747
748
748
For commands that take additional arguments we can use
749
749
kwargs. So ``{filemd5: object_id, root: file_root}`` becomes:
Original file line number Diff line number Diff line change @@ -869,7 +869,7 @@ def test_commands(self):
869
869
# End runCommand Example 1
870
870
871
871
# Start runCommand Example 2
872
- db .command ("collStats " , "restaurants" )
872
+ db .command ("count " , "restaurants" )
873
873
# End runCommand Example 2
874
874
875
875
def test_index_management (self ):
Original file line number Diff line number Diff line change 49
49
"description" : " collection is created with the correct options" ,
50
50
"operations" : [
51
51
{
52
- "name " : " runCommand " ,
53
- "object " : " database0 " ,
52
+ "object " : " collection0 " ,
53
+ "name " : " aggregate " ,
54
54
"arguments" : {
55
- "commandName" : " collStats" ,
56
- "command" : {
57
- "collStats" : " coll0" ,
58
- "scale" : 1
59
- }
55
+ "pipeline" : [
56
+ {
57
+ "$collStats" : {
58
+ "storageStats" : {}
59
+ }
60
+ },
61
+ {
62
+ "$project" : {
63
+ "capped" : " $storageStats.capped" ,
64
+ "maxSize" : " $storageStats.maxSize"
65
+ }
66
+ }
67
+ ]
60
68
},
61
- "expectResult" : {
62
- "capped" : true ,
63
- "maxSize" : 4096
64
- }
69
+ "expectResult" : [
70
+ {
71
+ "capped" : true ,
72
+ "maxSize" : 4096
73
+ }
74
+ ]
65
75
}
66
76
]
67
77
}
You can’t perform that action at this time.
0 commit comments