mongoid 7.2.1 → 7.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +1 -1
- data/Rakefile +16 -0
- data/lib/config/locales/en.yml +2 -2
- data/lib/mongoid/association/accessors.rb +13 -1
- data/lib/mongoid/association/constrainable.rb +1 -1
- data/lib/mongoid/association/depending.rb +4 -4
- data/lib/mongoid/association/embedded/batchable.rb +1 -1
- data/lib/mongoid/association/embedded/embedded_in.rb +1 -1
- data/lib/mongoid/association/embedded/embeds_many/proxy.rb +10 -3
- data/lib/mongoid/association/nested/many.rb +1 -1
- data/lib/mongoid/association/nested/one.rb +4 -2
- data/lib/mongoid/association/proxy.rb +6 -1
- data/lib/mongoid/association/referenced/auto_save.rb +2 -2
- data/lib/mongoid/association/referenced/has_many/enumerable.rb +493 -495
- data/lib/mongoid/association/referenced/has_many/proxy.rb +2 -2
- data/lib/mongoid/association/referenced/has_one/nested_builder.rb +2 -2
- data/lib/mongoid/attributes.rb +32 -14
- data/lib/mongoid/attributes/projector.rb +120 -0
- data/lib/mongoid/cacheable.rb +2 -2
- data/lib/mongoid/clients.rb +1 -1
- data/lib/mongoid/clients/factory.rb +22 -8
- data/lib/mongoid/config.rb +19 -2
- data/lib/mongoid/contextual/aggregable/mongo.rb +10 -8
- data/lib/mongoid/copyable.rb +1 -1
- data/lib/mongoid/criteria.rb +4 -5
- data/lib/mongoid/criteria/findable.rb +1 -1
- data/lib/mongoid/criteria/queryable/expandable.rb +0 -24
- data/lib/mongoid/criteria/queryable/extensions.rb +0 -4
- data/lib/mongoid/criteria/queryable/extensions/boolean.rb +1 -1
- data/lib/mongoid/criteria/queryable/mergeable.rb +46 -20
- data/lib/mongoid/criteria/queryable/selectable.rb +8 -8
- data/lib/mongoid/document.rb +1 -15
- data/lib/mongoid/errors/delete_restriction.rb +8 -9
- data/lib/mongoid/errors/mongoid_error.rb +1 -1
- data/lib/mongoid/evolvable.rb +1 -1
- data/lib/mongoid/extensions/boolean.rb +1 -2
- data/lib/mongoid/extensions/false_class.rb +1 -1
- data/lib/mongoid/extensions/hash.rb +2 -2
- data/lib/mongoid/extensions/true_class.rb +1 -1
- data/lib/mongoid/fields.rb +43 -5
- data/lib/mongoid/inspectable.rb +1 -1
- data/lib/mongoid/matcher.rb +26 -43
- data/lib/mongoid/matcher/bits.rb +41 -0
- data/lib/mongoid/matcher/bits_all_clear.rb +20 -0
- data/lib/mongoid/matcher/bits_all_set.rb +20 -0
- data/lib/mongoid/matcher/bits_any_clear.rb +20 -0
- data/lib/mongoid/matcher/bits_any_set.rb +20 -0
- data/lib/mongoid/matcher/elem_match.rb +2 -1
- data/lib/mongoid/matcher/expression.rb +9 -14
- data/lib/mongoid/matcher/field_expression.rb +4 -5
- data/lib/mongoid/matcher/field_operator.rb +6 -0
- data/lib/mongoid/matcher/mod.rb +17 -0
- data/lib/mongoid/matcher/type.rb +99 -0
- data/lib/mongoid/persistable/deletable.rb +1 -2
- data/lib/mongoid/persistable/destroyable.rb +8 -2
- data/lib/mongoid/persistable/updatable.rb +27 -2
- data/lib/mongoid/query_cache.rb +35 -29
- data/lib/mongoid/reloadable.rb +5 -0
- data/lib/mongoid/selectable.rb +5 -7
- data/lib/mongoid/shardable.rb +21 -5
- data/lib/mongoid/touchable.rb +23 -4
- data/lib/mongoid/validatable/associated.rb +1 -1
- data/lib/mongoid/validatable/presence.rb +3 -3
- data/lib/mongoid/validatable/uniqueness.rb +1 -1
- data/lib/mongoid/version.rb +1 -1
- data/lib/rails/generators/mongoid/config/config_generator.rb +8 -1
- data/lib/rails/generators/mongoid/config/templates/mongoid.yml +1 -1
- data/spec/integration/app_spec.rb +139 -82
- data/spec/integration/associations/embeds_many_spec.rb +44 -0
- data/spec/integration/associations/has_one_spec.rb +48 -0
- data/spec/integration/criteria/date_field_spec.rb +1 -1
- data/spec/integration/document_spec.rb +30 -0
- data/spec/integration/matcher_operator_data/bits_all_clear.yml +159 -0
- data/spec/integration/matcher_operator_data/bits_all_set.yml +159 -0
- data/spec/integration/matcher_operator_data/bits_any_clear.yml +159 -0
- data/spec/integration/matcher_operator_data/bits_any_set.yml +159 -0
- data/spec/integration/matcher_operator_data/comment.yml +22 -0
- data/spec/integration/matcher_operator_data/elem_match.yml +46 -0
- data/spec/integration/matcher_operator_data/implicit_traversal.yml +96 -0
- data/spec/integration/matcher_operator_data/in.yml +16 -0
- data/spec/integration/matcher_operator_data/mod.yml +55 -0
- data/spec/integration/matcher_operator_data/type.yml +70 -0
- data/spec/integration/matcher_operator_data/type_array.yml +16 -0
- data/spec/integration/matcher_operator_data/type_binary.yml +18 -0
- data/spec/integration/matcher_operator_data/type_boolean.yml +39 -0
- data/spec/integration/matcher_operator_data/type_code.yml +26 -0
- data/spec/integration/matcher_operator_data/type_code_with_scope.yml +26 -0
- data/spec/integration/matcher_operator_data/type_date.yml +39 -0
- data/spec/integration/matcher_operator_data/type_db_pointer.yml +19 -0
- data/spec/integration/matcher_operator_data/type_decimal.yml +40 -0
- data/spec/integration/matcher_operator_data/type_double.yml +15 -0
- data/spec/integration/matcher_operator_data/type_int32.yml +33 -0
- data/spec/integration/matcher_operator_data/type_int64.yml +33 -0
- data/spec/integration/matcher_operator_data/type_max_key.yml +17 -0
- data/spec/integration/matcher_operator_data/type_min_key.yml +17 -0
- data/spec/integration/matcher_operator_data/type_null.yml +23 -0
- data/spec/integration/matcher_operator_data/type_object.yml +23 -0
- data/spec/integration/matcher_operator_data/type_object_id.yml +25 -0
- data/spec/integration/matcher_operator_data/type_regex.yml +44 -0
- data/spec/integration/matcher_operator_data/type_string.yml +15 -0
- data/spec/integration/matcher_operator_data/type_symbol.yml +32 -0
- data/spec/integration/matcher_operator_data/type_timestamp.yml +25 -0
- data/spec/integration/matcher_operator_data/type_undefined.yml +17 -0
- data/spec/lite_spec_helper.rb +4 -3
- data/spec/mongoid/association/depending_spec.rb +391 -352
- data/spec/mongoid/association/nested/one_spec.rb +18 -14
- data/spec/mongoid/association/referenced/belongs_to/proxy_spec.rb +25 -8
- data/spec/mongoid/association/referenced/has_and_belongs_to_many/binding_spec.rb +1 -1
- data/spec/mongoid/association/referenced/has_many/binding_spec.rb +1 -1
- data/spec/mongoid/association/referenced/has_many/enumerable_spec.rb +1 -1
- data/spec/mongoid/association/referenced/has_one_models.rb +8 -0
- data/spec/mongoid/atomic/paths_spec.rb +64 -12
- data/spec/mongoid/attributes/projector_data/embedded.yml +105 -0
- data/spec/mongoid/attributes/projector_data/fields.yml +93 -0
- data/spec/mongoid/attributes/projector_spec.rb +41 -0
- data/spec/mongoid/attributes_spec.rb +333 -0
- data/spec/mongoid/clients/factory_spec.rb +48 -0
- data/spec/mongoid/config_spec.rb +32 -0
- data/spec/mongoid/contextual/atomic_spec.rb +17 -4
- data/spec/mongoid/contextual/mongo_spec.rb +2 -2
- data/spec/mongoid/criteria/modifiable_spec.rb +1 -1
- data/spec/mongoid/criteria/queryable/expandable_spec.rb +0 -73
- data/spec/mongoid/criteria/queryable/extensions/boolean_spec.rb +1 -1
- data/spec/mongoid/criteria/queryable/mergeable_spec.rb +105 -7
- data/spec/mongoid/criteria/queryable/selectable_logical_spec.rb +229 -24
- data/spec/mongoid/criteria/queryable/selectable_shared_examples.rb +39 -0
- data/spec/mongoid/criteria/queryable/selectable_spec.rb +1 -565
- data/spec/mongoid/criteria/queryable/selectable_where_spec.rb +590 -0
- data/spec/mongoid/criteria_projection_spec.rb +411 -0
- data/spec/mongoid/criteria_spec.rb +0 -275
- data/spec/mongoid/document_fields_spec.rb +26 -0
- data/spec/mongoid/document_query_spec.rb +51 -0
- data/spec/mongoid/document_spec.rb +13 -13
- data/spec/mongoid/errors/delete_restriction_spec.rb +1 -1
- data/spec/mongoid/errors/mongoid_error_spec.rb +20 -8
- data/spec/mongoid/extensions/false_class_spec.rb +1 -1
- data/spec/mongoid/extensions/string_spec.rb +5 -5
- data/spec/mongoid/extensions/true_class_spec.rb +1 -1
- data/spec/mongoid/fields/localized_spec.rb +4 -4
- data/spec/mongoid/fields_spec.rb +4 -4
- data/spec/mongoid/inspectable_spec.rb +12 -4
- data/spec/mongoid/matcher/extract_attribute_data/numeric_keys.yml +104 -0
- data/spec/mongoid/matcher/extract_attribute_data/traversal.yml +68 -88
- data/spec/mongoid/matcher/extract_attribute_spec.rb +3 -13
- data/spec/mongoid/persistable/deletable_spec.rb +175 -1
- data/spec/mongoid/persistable/destroyable_spec.rb +191 -3
- data/spec/mongoid/persistable/savable_spec.rb +3 -5
- data/spec/mongoid/persistable/settable_spec.rb +30 -0
- data/spec/mongoid/persistable/upsertable_spec.rb +1 -1
- data/spec/mongoid/persistable_spec.rb +2 -2
- data/spec/mongoid/query_cache_middleware_spec.rb +8 -0
- data/spec/mongoid/reloadable_spec.rb +18 -1
- data/spec/mongoid/shardable_spec.rb +44 -0
- data/spec/mongoid/touchable_spec.rb +104 -16
- data/spec/mongoid/touchable_spec_models.rb +52 -0
- data/spec/mongoid/validatable_spec.rb +1 -1
- data/spec/shared/bin/get-mongodb-download-url +17 -0
- data/spec/shared/bin/s3-copy +45 -0
- data/spec/shared/bin/s3-upload +69 -0
- data/spec/shared/lib/mrss/cluster_config.rb +19 -4
- data/spec/shared/lib/mrss/constraints.rb +46 -8
- data/spec/shared/lib/mrss/docker_runner.rb +10 -1
- data/spec/shared/lib/mrss/lite_constraints.rb +16 -0
- data/spec/shared/lib/mrss/server_version_registry.rb +79 -33
- data/spec/shared/lib/mrss/spec_organizer.rb +32 -2
- data/spec/shared/lib/mrss/utils.rb +15 -0
- data/spec/shared/share/Dockerfile.erb +122 -29
- data/spec/shared/share/haproxy-1.conf +16 -0
- data/spec/shared/share/haproxy-2.conf +17 -0
- data/spec/shared/shlib/server.sh +58 -11
- data/spec/shared/shlib/set_env.sh +4 -1
- data/spec/spec_helper.rb +7 -3
- data/spec/support/client_registry.rb +9 -0
- data/spec/support/models/bolt.rb +8 -0
- data/spec/support/models/hole.rb +13 -0
- data/spec/support/models/mop.rb +9 -0
- data/spec/support/models/nut.rb +8 -0
- data/spec/support/models/person.rb +6 -0
- data/spec/support/models/sealer.rb +8 -0
- data/spec/support/models/shirt.rb +12 -0
- data/spec/support/models/spacer.rb +8 -0
- data/spec/support/models/threadlocker.rb +8 -0
- data/spec/support/models/washer.rb +8 -0
- data/spec/support/spec_config.rb +8 -0
- metadata +636 -528
- metadata.gz.sig +0 -0
- data/spec/support/cluster_config.rb +0 -158
@@ -192,3 +192,19 @@
|
|
192
192
|
end: 20
|
193
193
|
excl: false
|
194
194
|
error: true
|
195
|
+
|
196
|
+
- name: scalar field - symbol operator - matches
|
197
|
+
document:
|
198
|
+
count: 10
|
199
|
+
query:
|
200
|
+
count:
|
201
|
+
:$in: [10, 11]
|
202
|
+
matches: true
|
203
|
+
|
204
|
+
- name: scalar field - symbol operator - does not match
|
205
|
+
document:
|
206
|
+
count: 8
|
207
|
+
query:
|
208
|
+
count:
|
209
|
+
:$in: [10, 11]
|
210
|
+
matches: false
|
@@ -0,0 +1,55 @@
|
|
1
|
+
- name: existing field - matches
|
2
|
+
document:
|
3
|
+
pi: 8
|
4
|
+
query:
|
5
|
+
pi:
|
6
|
+
$mod: [5, 3]
|
7
|
+
matches: true
|
8
|
+
|
9
|
+
- name: existing field - does not match
|
10
|
+
document:
|
11
|
+
pi: 9
|
12
|
+
query:
|
13
|
+
pi:
|
14
|
+
$mod: [5, 3]
|
15
|
+
matches: false
|
16
|
+
|
17
|
+
- name: invalid condition
|
18
|
+
document:
|
19
|
+
pi: 9
|
20
|
+
query:
|
21
|
+
pi:
|
22
|
+
$mod: 5
|
23
|
+
error: true
|
24
|
+
|
25
|
+
- name: invalid field
|
26
|
+
document:
|
27
|
+
pi: [1, 2]
|
28
|
+
query:
|
29
|
+
pi:
|
30
|
+
$mod: 5
|
31
|
+
error: true
|
32
|
+
|
33
|
+
- name: array too short
|
34
|
+
document:
|
35
|
+
pi: 3
|
36
|
+
query:
|
37
|
+
pi:
|
38
|
+
$mod: [5]
|
39
|
+
error: true
|
40
|
+
|
41
|
+
- name: empty array
|
42
|
+
document:
|
43
|
+
pi: 3
|
44
|
+
query:
|
45
|
+
pi:
|
46
|
+
$mod: []
|
47
|
+
error: true
|
48
|
+
|
49
|
+
- name: array too long
|
50
|
+
document:
|
51
|
+
pi: 3
|
52
|
+
query:
|
53
|
+
pi:
|
54
|
+
$mod: [1, 2, 3]
|
55
|
+
error: true
|
@@ -0,0 +1,70 @@
|
|
1
|
+
- name: type is 0
|
2
|
+
document:
|
3
|
+
pi: 3.14
|
4
|
+
query:
|
5
|
+
pi:
|
6
|
+
$type: 0
|
7
|
+
error: true
|
8
|
+
min_server_version: 4.2
|
9
|
+
|
10
|
+
- name: type is too negative
|
11
|
+
document:
|
12
|
+
pi: 3.14
|
13
|
+
query:
|
14
|
+
pi:
|
15
|
+
$type: -2
|
16
|
+
error: true
|
17
|
+
min_server_version: 3.2
|
18
|
+
|
19
|
+
- name: type is too large
|
20
|
+
document:
|
21
|
+
pi: 3.14
|
22
|
+
query:
|
23
|
+
pi:
|
24
|
+
$type: 42
|
25
|
+
error: true
|
26
|
+
min_server_version: 3.2
|
27
|
+
|
28
|
+
- name: array argument for type - matches
|
29
|
+
document:
|
30
|
+
pi: 3.14
|
31
|
+
query:
|
32
|
+
pi:
|
33
|
+
$type: [1]
|
34
|
+
matches: true
|
35
|
+
min_server_version: 3.6
|
36
|
+
|
37
|
+
- name: array argument for type - does not match
|
38
|
+
document:
|
39
|
+
pi: 3.14
|
40
|
+
query:
|
41
|
+
pi:
|
42
|
+
$type: [2]
|
43
|
+
matches: false
|
44
|
+
min_server_version: 3.6
|
45
|
+
|
46
|
+
- name: hash argument
|
47
|
+
document:
|
48
|
+
pi: 3
|
49
|
+
query:
|
50
|
+
pi:
|
51
|
+
$type: {}
|
52
|
+
error: true
|
53
|
+
|
54
|
+
- name: array with multiple elements - matches
|
55
|
+
document:
|
56
|
+
pi: 3.14
|
57
|
+
query:
|
58
|
+
pi:
|
59
|
+
$type: [1, 2]
|
60
|
+
matches: true
|
61
|
+
min_server_version: 3.6
|
62
|
+
|
63
|
+
- name: array with multiple elements - does not match
|
64
|
+
document:
|
65
|
+
pi: 3.14
|
66
|
+
query:
|
67
|
+
pi:
|
68
|
+
$type: [2, 3]
|
69
|
+
matches: false
|
70
|
+
min_server_version: 3.6
|
@@ -0,0 +1,16 @@
|
|
1
|
+
- name: existing field - matches array
|
2
|
+
document:
|
3
|
+
prices: [1, 2, 3]
|
4
|
+
query:
|
5
|
+
prices:
|
6
|
+
$type: 4
|
7
|
+
matches: true
|
8
|
+
min_server_version: 3.6
|
9
|
+
|
10
|
+
- name: existing field - does not match array
|
11
|
+
document:
|
12
|
+
pi: 3
|
13
|
+
query:
|
14
|
+
pi:
|
15
|
+
$type: 4
|
16
|
+
matches: false
|
@@ -0,0 +1,18 @@
|
|
1
|
+
- name: existing field - matches binData
|
2
|
+
document:
|
3
|
+
price: !ruby/object:BSON::Binary
|
4
|
+
data: !binary |-
|
5
|
+
IW==
|
6
|
+
type: :generic
|
7
|
+
query:
|
8
|
+
price:
|
9
|
+
$type: 5
|
10
|
+
matches: true
|
11
|
+
|
12
|
+
- name: existing field - does not match binData
|
13
|
+
document:
|
14
|
+
price: 5
|
15
|
+
query:
|
16
|
+
price:
|
17
|
+
$type: 5
|
18
|
+
matches: false
|
@@ -0,0 +1,39 @@
|
|
1
|
+
- name: true value - matches
|
2
|
+
document:
|
3
|
+
status: true
|
4
|
+
query:
|
5
|
+
status:
|
6
|
+
$type: 8
|
7
|
+
matches: true
|
8
|
+
|
9
|
+
- name: false value - matches
|
10
|
+
document:
|
11
|
+
status: false
|
12
|
+
query:
|
13
|
+
status:
|
14
|
+
$type: 8
|
15
|
+
matches: true
|
16
|
+
|
17
|
+
- name: nil value - does not match
|
18
|
+
document:
|
19
|
+
status:
|
20
|
+
query:
|
21
|
+
status:
|
22
|
+
$type: 8
|
23
|
+
matches: false
|
24
|
+
|
25
|
+
- name: integer field - does not match
|
26
|
+
document:
|
27
|
+
pi: 3
|
28
|
+
query:
|
29
|
+
pi:
|
30
|
+
$type: 8
|
31
|
+
matches: false
|
32
|
+
|
33
|
+
- name: missing value - does not match
|
34
|
+
document:
|
35
|
+
x:
|
36
|
+
query:
|
37
|
+
status:
|
38
|
+
$type: 8
|
39
|
+
matches: false
|
@@ -0,0 +1,26 @@
|
|
1
|
+
- name: existing field - matches Code
|
2
|
+
document:
|
3
|
+
code: !ruby/object:BSON::Code
|
4
|
+
javascript: "var foo = 42;"
|
5
|
+
query:
|
6
|
+
code:
|
7
|
+
$type: 13
|
8
|
+
matches: true
|
9
|
+
|
10
|
+
- name: existing field - does not match Code
|
11
|
+
document:
|
12
|
+
code: 42
|
13
|
+
query:
|
14
|
+
code:
|
15
|
+
$type: 13
|
16
|
+
matches: false
|
17
|
+
|
18
|
+
- name: Code with Scope - does not match
|
19
|
+
document:
|
20
|
+
code: !ruby/object:BSON::CodeWithScope
|
21
|
+
javascript: "this.value = name"
|
22
|
+
scope: {name: "sid"}
|
23
|
+
query:
|
24
|
+
code:
|
25
|
+
$type: 13
|
26
|
+
matches: false
|
@@ -0,0 +1,26 @@
|
|
1
|
+
- name: existing field - matches Code with Scope
|
2
|
+
document:
|
3
|
+
code: !ruby/object:BSON::CodeWithScope
|
4
|
+
javascript: "this.value = name"
|
5
|
+
scope: {name: "sid"}
|
6
|
+
query:
|
7
|
+
code:
|
8
|
+
$type: 15
|
9
|
+
matches: true
|
10
|
+
|
11
|
+
- name: existing field - does not match Code with Scope
|
12
|
+
document:
|
13
|
+
code: 42
|
14
|
+
query:
|
15
|
+
code:
|
16
|
+
$type: 15
|
17
|
+
matches: false
|
18
|
+
|
19
|
+
- name: Code - does not match
|
20
|
+
document:
|
21
|
+
code: !ruby/object:BSON::Code
|
22
|
+
javascript: "var foo = 42;"
|
23
|
+
query:
|
24
|
+
code:
|
25
|
+
$type: 15
|
26
|
+
matches: false
|
@@ -0,0 +1,39 @@
|
|
1
|
+
- name: existing field - matches date with date_field
|
2
|
+
document:
|
3
|
+
date_field: 2020-11-19
|
4
|
+
query:
|
5
|
+
date_field:
|
6
|
+
$type: 9
|
7
|
+
matches: true
|
8
|
+
|
9
|
+
- name: existing field - matches date with time_field
|
10
|
+
document:
|
11
|
+
time_field: 2020-11-19 00:00:00
|
12
|
+
query:
|
13
|
+
time_field:
|
14
|
+
$type: 9
|
15
|
+
matches: true
|
16
|
+
|
17
|
+
- name: existing field - matches date with datetime_field
|
18
|
+
document:
|
19
|
+
datetime_field: 2020-11-19 00:00:00
|
20
|
+
query:
|
21
|
+
datetime_field:
|
22
|
+
$type: 9
|
23
|
+
matches: true
|
24
|
+
|
25
|
+
- name: existing field - matches date with default field
|
26
|
+
document:
|
27
|
+
day: 2020-11-19
|
28
|
+
query:
|
29
|
+
day:
|
30
|
+
$type: 9
|
31
|
+
matches: true
|
32
|
+
|
33
|
+
- name: existing field - does not match date
|
34
|
+
document:
|
35
|
+
name: 3
|
36
|
+
query:
|
37
|
+
name:
|
38
|
+
$type: 9
|
39
|
+
matches: false
|
@@ -0,0 +1,19 @@
|
|
1
|
+
- name: existing field - matches DBPointer
|
2
|
+
document:
|
3
|
+
ptr: !ruby/object:BSON::DbPointer
|
4
|
+
ref: "collection"
|
5
|
+
id: !ruby/object:BSON::ObjectId
|
6
|
+
raw_data: !binary |-
|
7
|
+
Xt0Zj+G4MlyV5hyJ
|
8
|
+
query:
|
9
|
+
ptr:
|
10
|
+
$type: 12
|
11
|
+
matches: true
|
12
|
+
|
13
|
+
- name: existing field - does not match DBPointer
|
14
|
+
document:
|
15
|
+
ptr: 3
|
16
|
+
query:
|
17
|
+
ptr:
|
18
|
+
$type: 12
|
19
|
+
matches: false
|
@@ -0,0 +1,40 @@
|
|
1
|
+
- name: Decimal128 in untyped field - matches
|
2
|
+
document:
|
3
|
+
number: !ruby/object:BSON::Decimal128
|
4
|
+
low: 4224
|
5
|
+
high: 3475653012423180288
|
6
|
+
query:
|
7
|
+
number:
|
8
|
+
$type: 19
|
9
|
+
matches: true
|
10
|
+
min_server_version: 3.4
|
11
|
+
|
12
|
+
- name: Decimal128 field - matches
|
13
|
+
document:
|
14
|
+
decimal128_field: !ruby/object:BSON::Decimal128
|
15
|
+
low: 4224
|
16
|
+
high: 3475653012423180288
|
17
|
+
query:
|
18
|
+
decimal128_field:
|
19
|
+
$type: 19
|
20
|
+
matches: true
|
21
|
+
min_server_version: 3.4
|
22
|
+
|
23
|
+
- name: existing field - does not match decimal
|
24
|
+
document:
|
25
|
+
name: "foo"
|
26
|
+
query:
|
27
|
+
name:
|
28
|
+
$type: 19
|
29
|
+
matches: false
|
30
|
+
min_server_version: 3.4
|
31
|
+
|
32
|
+
- name: BigDecimal field - does not match
|
33
|
+
document:
|
34
|
+
big_decimal_field: !ruby/object:BigDecimal
|
35
|
+
18:0.42e2
|
36
|
+
query:
|
37
|
+
big_decimal_field:
|
38
|
+
$type: 19
|
39
|
+
matches: false
|
40
|
+
min_server_version: 3.4
|
@@ -0,0 +1,33 @@
|
|
1
|
+
- name: bson int32 - matches
|
2
|
+
document:
|
3
|
+
pi: !ruby/object:BSON::Int32
|
4
|
+
value: 3
|
5
|
+
query:
|
6
|
+
pi:
|
7
|
+
$type: 16
|
8
|
+
matches: true
|
9
|
+
|
10
|
+
- name: small integer - matches
|
11
|
+
document:
|
12
|
+
pi: 3
|
13
|
+
query:
|
14
|
+
pi:
|
15
|
+
$type: 16
|
16
|
+
matches: true
|
17
|
+
|
18
|
+
- name: big integer - does not match
|
19
|
+
document:
|
20
|
+
# Exactly 2**32
|
21
|
+
pi: 4294967296
|
22
|
+
query:
|
23
|
+
pi:
|
24
|
+
$type: 16
|
25
|
+
matches: false
|
26
|
+
|
27
|
+
- name: float - does not match
|
28
|
+
document:
|
29
|
+
pi: 3.14
|
30
|
+
query:
|
31
|
+
pi:
|
32
|
+
$type: 16
|
33
|
+
matches: false
|
@@ -0,0 +1,33 @@
|
|
1
|
+
- name: bson int64 - matches
|
2
|
+
document:
|
3
|
+
number: !ruby/object:BSON::Int64
|
4
|
+
value: 392141
|
5
|
+
query:
|
6
|
+
number:
|
7
|
+
$type: 18
|
8
|
+
matches: true
|
9
|
+
|
10
|
+
- name: small integer - does not match
|
11
|
+
document:
|
12
|
+
pi: 3
|
13
|
+
query:
|
14
|
+
pi:
|
15
|
+
$type: 18
|
16
|
+
matches: false
|
17
|
+
|
18
|
+
- name: big integer - matches
|
19
|
+
document:
|
20
|
+
# Exactly 2**32
|
21
|
+
pi: 4294967296
|
22
|
+
query:
|
23
|
+
pi:
|
24
|
+
$type: 18
|
25
|
+
matches: true
|
26
|
+
|
27
|
+
- name: existing field - does not match long
|
28
|
+
document:
|
29
|
+
name: "foo"
|
30
|
+
query:
|
31
|
+
name:
|
32
|
+
$type: 18
|
33
|
+
matches: false
|