Marshals both the body and sync data for a given document. If there is no rawbody already available then we will marshall it all in one go. Otherwise we will reduce marshalling as much as possible by only marshalling the sync data and injecting it into the existing raw body.
()
| 324 | // marshall it all in one go. Otherwise we will reduce marshalling as much as possible by only marshalling the sync data |
| 325 | // and injecting it into the existing raw body. |
| 326 | func (doc *Document) MarshalBodyAndSync() (retBytes []byte, err error) { |
| 327 | if doc._rawBody != nil { |
| 328 | return base.InjectJSONProperties(doc._rawBody, base.KVPair{Key: base.SyncPropertyName, Val: doc.SyncData}) |
| 329 | } else { |
| 330 | return base.JSONMarshal(doc) |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | func (doc *Document) IsDeleted() bool { |
| 335 | return doc.hasFlag(channels.Deleted) |
no test coverage detected