MCPcopy Create free account
hub / github.com/MariaDB/server / DocWrite

Method DocWrite

storage/connect/cmgoconn.cpp:638–661  ·  view source on GitHub ↗

/ DocWrite. */ /

Source from the content-addressed store, hash-verified

636/* DocWrite. */
637/***********************************************************************/
638bool CMgoConn::DocWrite(PGLOBAL g, PINCOL icp)
639{
640 for (PKC kp = icp->Klist; kp; kp = kp->Next)
641 if (kp->Incolp) {
642 bool isdoc = !kp->Array;
643
644 if (isdoc)
645 BSON_APPEND_DOCUMENT_BEGIN(icp->Child, kp->Key, kp->Incolp->Child);
646 else
647 BSON_APPEND_ARRAY_BEGIN(icp->Child, kp->Key, kp->Incolp->Child);
648
649 if (DocWrite(g, kp->Incolp))
650 return true;
651
652 if (isdoc)
653 bson_append_document_end(icp->Child, kp->Incolp->Child);
654 else
655 bson_append_array_end(icp->Child, kp->Incolp->Child);
656
657 } else if (AddValue(g, kp->Colp, icp->Child, kp->Key, false))
658 return true;
659
660 return false;
661} // end of DocWrite
662
663/***********************************************************************/
664/* WriteDB: Data Base write routine for CMGO access method. */

Callers 2

WriteDBMethod · 0.45
WriteBufferMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected