monastery 1.34.0 → 1.36.1

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.
@@ -0,0 +1,122 @@
1
+ module.exports.bird = {
2
+ schema: function() {
3
+ return {
4
+ fields: {
5
+ color: { type: 'string', default: 'red' },
6
+ height: { type: 'number' },
7
+ name: { type: 'string' },
8
+ sub: {
9
+ color: { type: 'string', default: 'red' },
10
+ },
11
+ wing: {
12
+ size: { type: 'number' },
13
+ sizes: {
14
+ one: { type: 'number' },
15
+ two: { type: 'number' },
16
+ }
17
+ },
18
+ },
19
+ findBL: ['wing'],
20
+ }
21
+ },
22
+ mock: function() {
23
+ return {
24
+ height: 12,
25
+ name: 'Ponyo',
26
+ sub: {},
27
+ wing: { size: 1, sizes: { one: 1, two: 1 }},
28
+ }
29
+ },
30
+ }
31
+
32
+ module.exports.user = {
33
+ schema: function() {
34
+ return {
35
+ fields: {
36
+ bird: { model: 'bird' },
37
+ list: [{ type: 'number' }],
38
+ dog: { type: 'string' },
39
+ pet: { type: 'string' },
40
+ pets: [{
41
+ name: { type: 'string'},
42
+ age: { type: 'number'}
43
+ }],
44
+ animals: {
45
+ cat: { type: 'string' },
46
+ dog: { type: 'string' }
47
+ },
48
+ hiddenPets: [{
49
+ name: { type: 'string'}
50
+ }],
51
+ hiddenList: [{ type: 'number'}],
52
+ deep: {
53
+ deep2: {
54
+ deep3: {
55
+ deep4: { type: 'string' }
56
+ }
57
+ }
58
+ },
59
+ deeper: {
60
+ deeper2: {
61
+ deeper3: {
62
+ deeper4: { type: 'string' }
63
+ }
64
+ }
65
+ },
66
+ deepModel: {
67
+ myBird: { model: 'bird' }
68
+ },
69
+ hiddenDeepModel: {
70
+ myBird: { model: 'bird' }
71
+ },
72
+ },
73
+ findBL: [
74
+ 'dog',
75
+ 'animals.cat',
76
+ 'pets.age',
77
+ 'hiddenPets',
78
+ 'hiddenList',
79
+ 'deep.deep2.deep3',
80
+ 'deeper',
81
+ 'hiddenDeepModel',
82
+ ],
83
+ }
84
+ },
85
+ mock: function(bird1) {
86
+ return {
87
+ bird: bird1._id,
88
+ list: [44, 54],
89
+ dog: 'Bruce',
90
+ pet: 'Freddy',
91
+ pets: [{ name: 'Pluto', age: 5 }, { name: 'Milo', age: 4 }],
92
+ animals: {
93
+ cat: 'Ginger',
94
+ dog: 'Max'
95
+ },
96
+ hiddenPets: [{
97
+ name: 'secretPet'
98
+ }],
99
+ hiddenList: [12, 23],
100
+ deep: {
101
+ deep2: {
102
+ deep3: {
103
+ deep4: 'hideme'
104
+ }
105
+ }
106
+ },
107
+ deeper: {
108
+ deeper2: {
109
+ deeper3: {
110
+ deeper4: 'hideme'
111
+ }
112
+ }
113
+ },
114
+ deepModel: {
115
+ myBird: bird1._id
116
+ },
117
+ hiddenDeepModel: {
118
+ myBird: bird1._id
119
+ }
120
+ }
121
+ },
122
+ }
package/test/monk.js CHANGED
@@ -1,6 +1,6 @@
1
1
  module.exports = function(monastery, opendb) {
2
2
 
3
- test('Monk confilicts', async () => {
3
+ test('Monk conflicts', async () => {
4
4
  // Setup
5
5
  let db = (await opendb(false)).db
6
6
  let monkdb = require('monk')(':badconnection', () => {})