mongocore 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/lib/mongocore/query.rb +2 -2
- data/lib/mongocore.rb +1 -0
- data/mongocore.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1632e0446a4711953c509726122f1c51538e5c71
|
4
|
+
data.tar.gz: 610443c8728e6641559c819134ceb50d78499c4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38a33cbffc7ccd7e6322f7ee17bdc4df74bd78e655259a57b60626c0385b52c7ce425d9f8d57c7c1684d4aa1682d9f1c485fcbe792bc8bd5f472ac0a8760a4bf
|
7
|
+
data.tar.gz: 22bcda0691d064dbc99f2f1b029193a7aae015bf0cd63882139a4cd320338990f26f7a00234e59ded41b039800e45129ef99de7b68326027c0b316e5f3dde36b
|
data/README.md
CHANGED
@@ -15,13 +15,13 @@ With Mongocore you can do:
|
|
15
15
|
|
16
16
|
The schema is specified with a YAML file which supports default values, data types, and security levels for each key.
|
17
17
|
|
18
|
-
Please read [the source code](https://github.com/fugroup/mongocore/tree/master/lib/mongocore) to see how it works, it's fully commented and very small, only
|
18
|
+
Please read [the source code](https://github.com/fugroup/mongocore/tree/master/lib/mongocore) to see how it works, it's fully commented and very small, only 8 files, and 360 lines of fully test driven code.
|
19
19
|
|
20
20
|
| Library | Files | Comment | Lines of code |
|
21
21
|
| -------------------------------------- | ----- | ------- | ------------- |
|
22
22
|
| [Mongoid](http://mongoid.com) | 256 | 14371 | 10590 |
|
23
23
|
| [MongoMapper](http://mongomapper.com) | 91 | 200 | 4070 |
|
24
|
-
| [Mongocore](http://mongocore.com) | 8 |
|
24
|
+
| [Mongocore](http://mongocore.com) | 8 | 230 | 360 |
|
25
25
|
|
26
26
|
<br>
|
27
27
|
|
@@ -131,6 +131,9 @@ m = p.models.last
|
|
131
131
|
c = Model.count
|
132
132
|
c = p.models.featured.count
|
133
133
|
|
134
|
+
# Skip
|
135
|
+
m = Model.find.skip(2).first
|
136
|
+
|
134
137
|
# Tagged keys for attributes and to_json
|
135
138
|
m = Model.first
|
136
139
|
m.attributes # => All attributes
|
data/lib/mongocore/query.rb
CHANGED
@@ -28,7 +28,7 @@ module Mongocore
|
|
28
28
|
@model = m
|
29
29
|
|
30
30
|
# The model name is singular, the collection name is plural
|
31
|
-
@colname =
|
31
|
+
@colname = m.to_s.downcase.pluralize.to_sym
|
32
32
|
|
33
33
|
# Storing the Mongo::Collection object
|
34
34
|
@collection = Mongocore.db[@colname]
|
@@ -64,7 +64,7 @@ module Mongocore
|
|
64
64
|
|
65
65
|
# Delete
|
66
66
|
def delete
|
67
|
-
@collection.delete_one(@query)
|
67
|
+
@collection.delete_one(@query).ok?
|
68
68
|
end
|
69
69
|
|
70
70
|
# Count. Returns the number of documents as an integer
|
data/lib/mongocore.rb
CHANGED
data/mongocore.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'mongocore'
|
3
|
-
s.version = '0.1.
|
4
|
-
s.date = '2017-10-
|
3
|
+
s.version = '0.1.3'
|
4
|
+
s.date = '2017-10-15'
|
5
5
|
s.summary = "MongoDB ORM implementation on top of the Ruby MongoDB driver"
|
6
6
|
s.description = "Does validations, associations, scopes, filters, pagination, counter cache, request cache, and nested queries. Using a YAML schema file, which supports default values, data types, and security levels for each key."
|
7
7
|
s.authors = ["Fugroup Limited"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongocore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fugroup Limited
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongo
|