Skip to content

Commit 908b104

Browse files
committed
Do not valid the bson when ensure index.
the valid will refuse to accept dot(.) or dollar($) as the bson tag. But for embed field to index, which need using dot as a tag name.
1 parent 899a649 commit 908b104

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mongoc/mongoc-collection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ mongoc_collection_ensure_index (mongoc_collection_t *collection,
635635
col = mongoc_client_get_collection (collection->client, collection->db,
636636
"system.indexes");
637637

638-
ret = mongoc_collection_insert (col, MONGOC_INSERT_NONE, &insert, NULL,
638+
ret = mongoc_collection_insert (col, MONGOC_INSERT_NO_VALIDATE, &insert, NULL,
639639
error);
640640

641641
mongoc_collection_destroy(col);

0 commit comments

Comments
 (0)