Skip to content

Commit 39094b0

Browse files
authored
DRIVERS-2467: Test $$type operator "number" alias (#1721)
1 parent 3a4c773 commit 39094b0

File tree

2 files changed

+235
-0
lines changed

2 files changed

+235
-0
lines changed

source/unified-test-format/tests/valid-pass/operator-type-number_alias.json

Lines changed: 174 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
description: operator-type-number_alias
2+
3+
schemaVersion: "1.0"
4+
5+
createEntities:
6+
- client:
7+
id: &client0 client0
8+
- database:
9+
id: &database0 database0
10+
client: *client0
11+
databaseName: &database0Name test
12+
- collection:
13+
id: &collection0 collection0
14+
database: *database0
15+
collectionName: &collection0Name coll0
16+
17+
initialData:
18+
- collectionName: *collection0Name
19+
databaseName: *database0Name
20+
documents: []
21+
22+
tests:
23+
-
24+
description: type number alias matches int32
25+
operations:
26+
- name: insertOne
27+
object: *collection0
28+
arguments:
29+
document: { _id: 1, x: { $numberInt: "2147483647" } }
30+
- &find
31+
name: find
32+
object: *collection0
33+
arguments:
34+
filter: { _id: 1 }
35+
limit: 1
36+
expectResult:
37+
- { _id: 1, x: { $$type: "number" } }
38+
-
39+
description: type number alias matches int64
40+
operations:
41+
- name: insertOne
42+
object: *collection0
43+
arguments:
44+
document: { _id: 1, x: { $numberLong: "9223372036854775807" } }
45+
- *find
46+
-
47+
description: type number alias matches double
48+
operations:
49+
- name: insertOne
50+
object: *collection0
51+
arguments:
52+
document: { _id: 1, x: { $numberDouble: "2.71828" } }
53+
- *find
54+
-
55+
description: type number alias matches decimal128
56+
operations:
57+
- name: insertOne
58+
object: *collection0
59+
arguments:
60+
document: { _id: 1, x: { $numberDecimal: "3.14159" } }
61+
- *find

0 commit comments

Comments
 (0)