Converts object to its JSON representation.
Accepts both reactive objects and snapshots.
JSON.stringify(obj) gives the same result for an in-memory object, which shares this serializer.
A database-backed object carries its own toJSON, which reads the document rather than the target
and still differs in two ways: it omits @uri, and it leaves Uint8Array values unencoded.
Prefer this function where the two must agree.
Converts object to its JSON representation. Accepts both reactive objects and snapshots.
JSON.stringify(obj)gives the same result for an in-memory object, which shares this serializer. A database-backed object carries its owntoJSON, which reads the document rather than the target and still differs in two ways: it omits@uri, and it leavesUint8Arrayvalues unencoded. Prefer this function where the two must agree.