mongous 0.2.1 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +73 -0
- data/README.adoc +176 -26
- data/README.ja.adoc +176 -26
- data/Rakefile +8 -8
- data/_Gemfile.lock +38 -0
- data/lib/mongous/base.rb +52 -8
- data/lib/mongous/document.rb +21 -10
- data/lib/mongous/extention.rb +45 -35
- data/lib/mongous/filter.rb +316 -230
- data/lib/mongous/version.rb +1 -1
- data/mongous.gemspec +4 -4
- data/sample/connect_auto_0.rb +9 -0
- data/sample/declare_compact_1.rb +5 -8
- data/sample/declare_compact_2.rb +38 -0
- data/sample/declare_label_1.rb +7 -7
- data/sample/declare_ndex_1.rb +6 -6
- data/sample/declare_ndex_2.rb +7 -7
- data/sample/declare_strict_1.rb +2 -4
- data/sample/declare_strict_2.rb +2 -4
- data/sample/multi_collection_1.rb +0 -2
- data/sample/multi_collection_2.rb +0 -2
- data/sample/multi_collection_3.rb +24 -0
- data/sample/query_basic_1.rb +10 -4
- data/sample/query_basic_2.rb +10 -4
- data/sample/query_basic_3.rb +0 -2
- data/sample/query_basic_4.rb +0 -2
- data/sample/query_basic_5.rb +0 -2
- data/sample/query_basic_6.rb +56 -0
- data/sample/query_detail_1.rb +2 -3
- data/sample/query_detail_2.rb +2 -3
- data/sample/query_detail_3.rb +0 -2
- data/sample/query_filter_1.rb +0 -2
- data/sample/query_filter_2.rb +0 -2
- data/sample/query_find_1.rb +14 -13
- data/sample/query_select_1.rb +54 -0
- data/sample/query_skip_limit_1.rb +17 -16
- data/sample/query_skip_limit_2.rb +19 -10
- data/sample/query_sort_1.rb +43 -0
- data/sample/save_basic_1.rb +1 -5
- data/sample/save_basic_2.rb +1 -5
- data/sample/save_basic_3.rb +1 -5
- data/sample/save_detail_1.rb +0 -2
- data/sample/save_detail_2.rb +0 -2
- data/sample/save_detail_3.rb +5 -7
- data/sample/save_verify_1.rb +2 -4
- data/sample/save_verify_2.rb +0 -2
- data/sample/save_verify_3.rb +0 -2
- data/sample/save_verify_4.rb +0 -2
- data/sample/save_verify_5.rb +0 -2
- data/sample/save_verify_6.rb +0 -2
- data/sample/save_verify_7.rb +0 -2
- data/sample/update_basic_1.rb +1 -5
- data/sample/zap_basic_1.rb +1 -5
- data/sample/zap_basic_2.rb +2 -6
- data/sample/zap_basic_3.rb +7 -0
- data/sample/zbenchmark_search_1.rb +114 -0
- data/sample/zbenchmark_search_2.rb +114 -0
- data/sample/zbenchmark_search_3.rb +88 -0
- metadata +31 -22
- data/.travis.yml +0 -6
- data/sample/query_projection_1.rb +0 -41
- data/sample/query_sort_order_1.rb +0 -46
data/.travis.yml
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
|
2
|
-
require "mongous"
|
3
|
-
|
4
|
-
Mongous.connect!
|
5
|
-
|
6
|
-
class Label
|
7
|
-
include Mongous::Document
|
8
|
-
end
|
9
|
-
|
10
|
-
(0...10).each do |n|
|
11
|
-
unless Label.where( n: n ).first
|
12
|
-
Label.create( n: n, tag: [0x40 + n].pack("C") )
|
13
|
-
end
|
14
|
-
end
|
15
|
-
puts
|
16
|
-
|
17
|
-
Label.each do |label|
|
18
|
-
p label
|
19
|
-
end
|
20
|
-
puts
|
21
|
-
|
22
|
-
Label.where.projection( tag: 1 ).each do |label|
|
23
|
-
p label
|
24
|
-
end
|
25
|
-
puts
|
26
|
-
|
27
|
-
Label.where.projection( _id: 0, n: 1 ).each do |label|
|
28
|
-
p label
|
29
|
-
end
|
30
|
-
puts
|
31
|
-
|
32
|
-
Label.where.select( _id: 0, n: 1, tag: 1 ).each do |label|
|
33
|
-
p label
|
34
|
-
end
|
35
|
-
puts
|
36
|
-
|
37
|
-
Label.where( n: [0,2,4,6,8] ).select( _id: 0, n: 1, tag: 1 ).each do |label|
|
38
|
-
p label
|
39
|
-
end
|
40
|
-
puts
|
41
|
-
|
@@ -1,46 +0,0 @@
|
|
1
|
-
|
2
|
-
require "mongous"
|
3
|
-
|
4
|
-
Mongous.connect!
|
5
|
-
|
6
|
-
class Item
|
7
|
-
include Mongous::Document
|
8
|
-
end
|
9
|
-
|
10
|
-
(0...10).each do |n|
|
11
|
-
unless Item.where( n: n ).first
|
12
|
-
Item.create( n: n )
|
13
|
-
end
|
14
|
-
end
|
15
|
-
puts
|
16
|
-
|
17
|
-
Item.each do |item|
|
18
|
-
p item
|
19
|
-
end
|
20
|
-
puts
|
21
|
-
|
22
|
-
Item.where.sort(n: 1).each do |item|
|
23
|
-
p item
|
24
|
-
end
|
25
|
-
puts
|
26
|
-
|
27
|
-
Item.where.sort(n: -1).each do |item|
|
28
|
-
p item
|
29
|
-
end
|
30
|
-
puts
|
31
|
-
|
32
|
-
Item.where.order(n: -1).each do |item|
|
33
|
-
p item
|
34
|
-
end
|
35
|
-
puts
|
36
|
-
|
37
|
-
Item.where( n: (3...8) ).order(n: -1).each do |item|
|
38
|
-
p item
|
39
|
-
end
|
40
|
-
puts
|
41
|
-
|
42
|
-
Item.where( n: [0,2,4,6,8] ).order(n: -1).each do |item|
|
43
|
-
p item
|
44
|
-
end
|
45
|
-
puts
|
46
|
-
|