mongocore 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mongocore.rb +23 -3
- 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: 15559a6ab53895176145f773faaff205c501289e
|
4
|
+
data.tar.gz: 29b028ec25e1035047404b83fcaa3a342162c640
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ae672dfcca254ff415fc76d25485af917cbd1dff5e750e1d688aa2160b92db56ef9e323358b6a291aaae0a4231c002ec6fd0c723c8be07e0deff9f10a86ca6f
|
7
|
+
data.tar.gz: bc320ce559c4372cd884f192c28aa98f0351d5a789adc1348c5bbf993cc02b0799af35876712362b4567b4a904b393459bed0c0b67eaf2e8609df000626edf24
|
data/lib/mongocore.rb
CHANGED
@@ -10,16 +10,36 @@ module Mongocore
|
|
10
10
|
# @license: MIT, contributions are welcome.
|
11
11
|
# # # # # #
|
12
12
|
|
13
|
-
class << self; attr_accessor :db, :schema, :cache, :access, :debug; end
|
13
|
+
class << self; attr_accessor :db, :schema, :cache, :access, :timestamps, :debug; end
|
14
14
|
|
15
15
|
# Schema path is $app_root/config/db/schema/:model_name.yml
|
16
16
|
@schema = File.join(Dir.pwd, 'config', 'db', 'schema')
|
17
|
-
|
17
|
+
|
18
|
+
# Enable the query cache
|
19
|
+
@cache = false
|
20
|
+
|
21
|
+
# Enabled the access control for keys
|
18
22
|
@access = true
|
19
|
-
|
23
|
+
|
24
|
+
# Enable timestamps, auto-save created_at and updated_at fields
|
25
|
+
@timestamps = true
|
26
|
+
|
27
|
+
# Debug option
|
28
|
+
@debug = false
|
20
29
|
end
|
21
30
|
|
22
31
|
require_relative 'mongocore/document'
|
23
32
|
require_relative 'mongocore/query'
|
33
|
+
require_relative 'mongocore/schema'
|
24
34
|
require_relative 'mongocore/access'
|
25
35
|
require_relative 'mongocore/cache'
|
36
|
+
require_relative 'mongocore/filters'
|
37
|
+
|
38
|
+
# Info on MongoDB Driver
|
39
|
+
# https://docs.mongodb.com/ruby-driver/master/quick-start/
|
40
|
+
# http://zetcode.com/db/mongodbruby/
|
41
|
+
# http://recipes.sinatrarb.com/p/databases/mongo
|
42
|
+
# https://github.com/steveren/ruby-driver-sample-app/blob/master/lib/neighborhood.rb
|
43
|
+
|
44
|
+
# Indexing
|
45
|
+
# Mongocore.db[:profiles].indexes.create_one({:key => 1}, :unique => true)
|
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.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fugroup Limited
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongo
|