mongo_light 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/mongo_light/document.rb +4 -4
- data/lib/mongo_light/version.rb +1 -1
- metadata +2 -2
data/lib/mongo_light/document.rb
CHANGED
|
@@ -14,21 +14,21 @@ module MongoLight
|
|
|
14
14
|
found = collection.find_one(real_id)
|
|
15
15
|
found.nil? ? nil : self.new(unmap(found))
|
|
16
16
|
end
|
|
17
|
-
def find_one(selector = {}, opts={})
|
|
17
|
+
def find_one(selector = {}, opts = {})
|
|
18
18
|
raw = opts.delete(:raw) || false
|
|
19
19
|
found = collection.find_one(map(selector), map_options(opts))
|
|
20
20
|
return nil if found.nil?
|
|
21
21
|
return raw ? unmap(found, true) : self.new(unmap(found))
|
|
22
22
|
end
|
|
23
|
-
def find(selector={}, opts={}, collection = nil)
|
|
23
|
+
def find(selector = {}, opts = {}, collection = nil)
|
|
24
24
|
raw = opts.delete(:raw) || false
|
|
25
25
|
opts[:transformer] = Proc.new{|data| raw ? unmap(data, raw) : self.new(unmap(data)) }
|
|
26
26
|
c = collection || self.collection
|
|
27
27
|
c.find(map(selector), map_options(opts))
|
|
28
28
|
end
|
|
29
|
-
def remove(selector={}, collection = nil)
|
|
29
|
+
def remove(selector = {}, options = {}, collection = nil)
|
|
30
30
|
c = collection || self.collection
|
|
31
|
-
c.remove(map(selector))
|
|
31
|
+
c.remove(map(selector), options)
|
|
32
32
|
end
|
|
33
33
|
def update(selector, document, options = {}, collection = nil)
|
|
34
34
|
c = collection || self.collection
|
data/lib/mongo_light/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mongo_light
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.8
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2011-
|
|
12
|
+
date: 2011-12-29 00:00:00.000000000 Z
|
|
13
13
|
dependencies: []
|
|
14
14
|
description:
|
|
15
15
|
email:
|