Skip to content

Commit 1387ab2

Browse files
committed
Consistent spacing
1 parent bb5f224 commit 1387ab2

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

examples/create.rb

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Insert a document
2+
23
require 'date'
34

45
result = client[:restaurants].insert_one({

examples/index.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Create a single field index
2+
23
result = client[:restaurants].indexes.create(cuisine: Mongo::Index::ASCENDING)
34

45
# Create a compound index
6+
57
result = client[:restaurants].indexes.create(cuisine: 1, zipcode: Mongo::Index::DESCENDING)

examples/query.rb

-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
puts doc
77
end
88

9-
109
# Query for equality on a top level field
1110

1211
cursor = client[:restaurants].find('borough' => 'Manhattan')
@@ -15,7 +14,6 @@
1514
puts doc
1615
end
1716

18-
1917
# Query by a field in an embedded document
2018

2119
cursor = client[:restaurants].find('address.zipcode' => '10075')
@@ -24,7 +22,6 @@
2422
puts doc
2523
end
2624

27-
2825
# Query by a field in an array
2926

3027
cursor = client[:restaurants].find('grades.grade' => 'B')
@@ -33,7 +30,6 @@
3330
puts doc
3431
end
3532

36-
3733
# Query with the greater-than operator
3834

3935
cursor = client[:restaurants].find('grades.score' => { '$gt' => 30 })
@@ -42,7 +38,6 @@
4238
puts doc
4339
end
4440

45-
4641
# Query with the less-than operator
4742

4843
cursor = client[:restaurants].find('grades.score' => { '$lt' => 10 })
@@ -51,7 +46,6 @@
5146
puts doc
5247
end
5348

54-
5549
# Query with a logical conjuction (AND) of query conditions
5650

5751
cursor = client[:restaurants].find({ 'cuisine' => 'Italian',
@@ -61,7 +55,6 @@
6155
puts doc
6256
end
6357

64-
6558
# Query with a logical disjunction (OR) of query conditions
6659

6760
cursor = client[:restaurants].find('$or' => [{ 'cuisine' => 'Italian' },
@@ -73,7 +66,6 @@
7366
puts doc
7467
end
7568

76-
7769
# Sort query results
7870

7971
cursor = client[:restaurants].find.sort('borough' => Mongo::Index::ASCENDING,

0 commit comments

Comments
 (0)