JSON Editing
JSON Format
The JSON field requires a pure JSON syntax. Special BSON types get encoded the same way as the Java driver.
Following are special types and a sample JSON representation:
- ObjectId: { "$oid": "51bb8d7c3004747a0b2e54d8" }
- Date: { "$date": "2013-06-14T21:38:20.762Z" } or { "$date": 1371245976 }
- Regular Expression: { "$regex": "^abc", "$options": "" }
- Code: { "$code": "function() { ... }", "$scope": { ... } }
- Timestamp: { "$ts": 1371245976, "$inc": 0 }
- UUID: { "$uuid": "700287f2-572f-41a7-9bda-10a59410a9fc" }
- DBRef: { "$ref": "test.collection", "$id": 123 }
- Binary: { "$type": 0, "$binary": "base64string" }
- MinKey: { "$minKey": 1 }
- MaxKey: { "$maxKey": 1 }
Tools
The following tools are available:
- Convert from Shell JSON: converts from shell JSON to Java JSON. Types like ObjectId() get converted to the pure JSON syntax.