Skip to content

Commit f8f917d

Browse files
committed
Delete example
1 parent d7d323c commit f8f917d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

examples/delete.rb

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Delete all documents matching a condition
2+
3+
client[:restaurants].find('borough' => 'Manhattan').delete_many
4+
5+
# Delete one document matching a condition
6+
7+
client[:restaurants].find('borough' => 'Queens').delete_one
8+
9+
# Delete all documents in a collection
10+
11+
client[:restaurants].find.delete_many
12+
13+
# Drop a collection
14+
15+
client[:restaurants].drop

0 commit comments

Comments
 (0)