[−][src]Function ejdb_sys::ejdbcommand
pub unsafe extern "C" fn ejdbcommand(
jb: *mut EJDB,
cmdbson: *mut bson
) -> *mut bson
Execute the ejdb database command.
Supported commands:
- Exports database collections data. See ejdbexport() method.
"export" : {
"path" : string, //Export files target directory
"cnames" : [string array]|null, //List of collection names to export
"mode" : int|null //Values: null|JBJSONEXPORT
See ejdbexport() method
}
Command response: { "log" : string, //Diagnostic log about executing this command "error" : string|null, //ejdb error message "errorCode" : int|0, //ejdb error code }
- Imports previously exported collections data into ejdb.
"import" : {
"path" : string //Import files source directory
"cnames" : [string array]|null, //List of collection names to import
"mode" : int|null //Values: null|JBIMPORTUPDATE
|JBIMPORTREPLACE
See ejdbimport() method
}
Command response: { "log" : string, //Diagnostic log about executing this command "error" : string|null, //ejdb error message "errorCode" : int|0, //ejdb error code }
@param jb EJDB database handle.
@param cmd BSON command spec.
@return Allocated command response BSON object. Caller should call bson_del()
on it.