Commits

Liam Staskawicz committed c61eef5

* test partial object

Comments (0)

Files changed (1)

test/CursorTest.fan

     
     coll.drop
   }
+  
+  Void testPartialObject()
+  {
+    coll := db["partialtest"]
+    coll.drop
+    o := ["field1":1, "field2":"two"]
+    coll.insert(o)
+    po := coll.findOne([:], ["fields":["field2"]])
+    verify(po.keys.contains("field2"))
+    verifyFalse(po.keys.contains("field1"))
+    // for comparisons sake
+    po = coll.findOne()
+    verify(po.keys.containsAll(["field1", "field2"]))
+    coll.drop
+  }
 
 }