c4coll_createDoc

Function c4coll_createDoc 

Source
pub unsafe extern "C" fn c4coll_createDoc(
    collection: *mut C4Collection,
    docID: C4String,
    body: C4Slice,
    revisionFlags: C4RevisionFlags,
    error: *mut C4Error,
) -> *mut C4Document
Expand description

Convenience function to create a new document. This just a wrapper around \ref c4coll_putDoc. If the document already exists, it will fail with the error kC4ErrorConflict. @note You must call \ref c4doc_release when finished with the document. @param collection The collection to create the document in @param docID Document ID to create; if null, a UUID will be generated @param body Body of the document @param revisionFlags The flags of the new revision @param error Information about any error that occurred @return On success, a new C4Document with the new revision selected; else NULL.