easymongo 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/easymongo.gemspec +1 -1
- data/lib/easymongo/document.rb +0 -1
- data/lib/easymongo/query.rb +12 -2
- data/lib/easymongo.rb +1 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cba05d54e026c7b45fb75333246960f67e9b69b8
|
4
|
+
data.tar.gz: 15dc3132d2094ca2d100906aebcdc6e40fab3cfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 898a6fdd306de4580a85eb94a988f3d9461a4745bf365df63339a61f91a9f1fec17c2f6456b1a25f067d88ce6d0393d2e67cf26a4b9d8bc35470dec35fba2979
|
7
|
+
data.tar.gz: e95bbe7722137580f8b179ae0a4902919bbe43d29de27aa01d308ef4e8fc6942cc7006b7ca51e1efd7cf51529c9250096cd60384b861bf6029b5b9bb07b84c84
|
data/CHANGELOG.md
CHANGED
data/easymongo.gemspec
CHANGED
data/lib/easymongo/document.rb
CHANGED
data/lib/easymongo/query.rb
CHANGED
@@ -56,6 +56,16 @@ module Easymongo
|
|
56
56
|
g!(d); s[:cursor] = cursor.limit(n.to_i); self
|
57
57
|
end
|
58
58
|
|
59
|
+
# Skip
|
60
|
+
def skip(n, d = {})
|
61
|
+
g!(d); s[:cursor] = cursor.skip(n.to_i); self
|
62
|
+
end
|
63
|
+
|
64
|
+
# Fields
|
65
|
+
def fields(data, d = {})
|
66
|
+
g!(d); s[:cursor] = cursor.projection(data); self
|
67
|
+
end
|
68
|
+
|
59
69
|
# Sort
|
60
70
|
def sort(data, d = {})
|
61
71
|
g!(d); s[:cursor] = cursor.sort(data); self
|
@@ -98,10 +108,10 @@ module Easymongo
|
|
98
108
|
def ids(data)
|
99
109
|
|
100
110
|
# Just return if nothing to do
|
101
|
-
return data if data.empty?
|
111
|
+
return data if data and data.empty?
|
102
112
|
|
103
113
|
# Support passing id as string
|
104
|
-
data = {'_id' => data} if data.is_a?(String)
|
114
|
+
data = {'_id' => data} if !data or data.is_a?(String)
|
105
115
|
|
106
116
|
# Turn all keys to string
|
107
117
|
data = data.stringify_keys
|
data/lib/easymongo.rb
CHANGED
@@ -6,9 +6,8 @@ module Easymongo
|
|
6
6
|
# @homepage: https://github.com/fugroup/easymongo
|
7
7
|
# @author: Vidar <vidar@fugroup.net>, Fugroup Ltd.
|
8
8
|
# @license: MIT, contributions are welcome.
|
9
|
-
# # # # # #
|
10
9
|
|
11
|
-
class << self; attr_accessor :
|
10
|
+
class << self; attr_accessor :schema; end
|
12
11
|
end
|
13
12
|
|
14
13
|
require_relative 'easymongo/document'
|