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

Method ReadNext

storage/connect/cmgoconn.cpp:521–541  ·  view source on GitHub ↗

/ Fetch next document. */ /

Source from the content-addressed store, hash-verified

519/* Fetch next document. */
520/***********************************************************************/
521int CMgoConn::ReadNext(PGLOBAL g)
522{
523 int rc = RC_OK;
524
525 if (!Cursor && MakeCursor(g)) {
526 rc = RC_FX;
527 } else if (mongoc_cursor_next(Cursor, &Document)) {
528 if (trace(512)) {
529 bson_iter_t iter;
530 ShowDocument(&iter, Document, "");
531 } else if (trace(1))
532 htrc("%s\n", GetDocument(g));
533
534 } else if (mongoc_cursor_error(Cursor, &Error)) {
535 snprintf(g->Message, sizeof(g->Message), "Mongo Cursor Failure: %s", Error.message);
536 rc = RC_FX;
537 } else
538 rc = RC_EF;
539
540 return rc;
541} // end of Fetch
542
543/***********************************************************************/
544/* Get the Json string of the current document. */

Callers 7

mainMethod · 0.45
mainMethod · 0.45
PrintResultMethod · 0.45
mainMethod · 0.45
ReadBufferMethod · 0.45
mainMethod · 0.45
ReadDBMethod · 0.45

Calls 1

htrcFunction · 0.70

Tested by 2

mainMethod · 0.36
mainMethod · 0.36