.\" Man page generated from reStructuredText. . .TH "MONGOC_MATCHER_T" "3" "Jun 04, 2021" "1.17.6" "libmongoc" .SH NAME mongoc_matcher_t \- mongoc_matcher_t . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .sp Client\-side document matching abstraction .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C typedef struct _mongoc_matcher_t mongoc_matcher_t; .ft P .fi .UNINDENT .UNINDENT .sp \fBmongoc_matcher_t\fP provides a reduced\-interface for client\-side matching of BSON documents. .sp It can perform the basics such as $in, $nin, $eq, $neq, $gt, $gte, $lt, and $lte. .sp \fBWARNING:\fP .INDENT 0.0 .INDENT 3.5 \fBmongoc_matcher_t\fP does not currently support the full spectrum of query operations that the MongoDB server supports. .UNINDENT .UNINDENT .SH DEPRECATED .sp \fBWARNING:\fP .INDENT 0.0 .INDENT 3.5 \fBmongoc_matcher_t\fP is deprecated and will be removed in version 2.0. .UNINDENT .UNINDENT .SH EXAMPLE .sp Filter a sequence of BSON documents from STDIN based on a query .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C #include #include #include int main (int argc, char *argv[]) { mongoc_matcher_t *matcher; bson_reader_t *reader; const bson_t *bson; bson_t *spec; char *str; int fd; mongoc_init (); #ifdef _WIN32 fd = fileno (stdin); #else fd = STDIN_FILENO; #endif reader = bson_reader_new_from_fd (fd, false); spec = BCON_NEW ("hello", "world"); matcher = mongoc_matcher_new (spec, NULL); while ((bson = bson_reader_read (reader, NULL))) { if (mongoc_matcher_match (matcher, bson)) { str = bson_as_canonical_extended_json (bson, NULL); printf ("%s\en", str); bson_free (str); } } bson_reader_destroy (reader); bson_destroy (spec); mongoc_cleanup (); return 0; } .ft P .fi .UNINDENT .UNINDENT .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .