@@ -258,6 +258,19 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
258258 const uuid = require ( 'uuid' ) ;
259259 const uuid1 = uuid . v4 ( ) ;
260260 const uuid2 = uuid . v4 ( ) ;
261+ const schema = {
262+ className : 'MyClass' ,
263+ fields : {
264+ x : { type : 'Number' } ,
265+ count : { type : 'Number' } ,
266+ } ,
267+ classLevelPermissions : { } ,
268+ } ;
269+
270+ const myClassSchema = new Parse . Schema ( schema . className ) ;
271+ myClassSchema . setCLP ( schema . classLevelPermissions ) ;
272+ await myClassSchema . save ( ) ;
273+
261274 const query = {
262275 x : 1 ,
263276 } ;
@@ -266,7 +279,6 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
266279 __op : 'SetOnInsert' ,
267280 amount : uuid1 ,
268281 } ,
269- x : 1 ,
270282 count : {
271283 __op : 'Increment' ,
272284 amount : 1 ,
@@ -285,12 +297,16 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
285297 update ,
286298 { upsert : true } ,
287299 ) ;
288- const q = new Parse . Query ( 'MyClass' ) ;
289- const docs = await q . find ( ) ;
290- expect ( docs . length ) . toBe ( 1 ) ;
291- expect ( docs [ 0 ] . id ) . toBe ( uuid1 ) ;
292- expect ( docs [ 0 ] . get ( 'x' ) ) . toBe ( 1 ) ;
293- expect ( docs [ 0 ] . get ( 'count' ) ) . toBe ( 2 ) ;
300+
301+ const res = await Parse . Server . database . find (
302+ schema . className ,
303+ { } ,
304+ { } ,
305+ ) ;
306+ expect ( res . length ) . toBe ( 1 ) ;
307+ expect ( res [ 0 ] . objectId ) . toBe ( uuid1 ) ;
308+ expect ( res [ 0 ] . count ) . toBe ( 2 ) ;
309+ expect ( res [ 0 ] . x ) . toBe ( 1 ) ;
294310 } ) ;
295311
296312 it ( 'handles updating a single object with array, object date' , done => {
0 commit comments