MCPcopy Create free account
hub / github.com/documentdb/documentdb / validateCollection

Function validateCollection

pg_documentdb/src/commands/validate.c:201–225  ·  view source on GitHub ↗

* validateCollection is the internal implementation for validating a collection. */

Source from the content-addressed store, hash-verified

199 * validateCollection is the internal implementation for validating a collection.
200 */
201static void
202validateCollection(MongoCollection *collection, ValidateResult *result)
203{
204 /* Validate indexes */
205
206 /* check the indisvalid column in pg_index */
207 CheckIndisvalid(collection->collectionId, result);
208
209 /*
210 * TODO Add further index validations here:
211 * 1. Unique indexes must not have duplicate documents
212 * 2. Hashed indexes should not be multikey
213 * 3. Except for multikey indexes, number of doc entries for an index should not be greater
214 * than num of docs in the collection
215 * 4. Number of _id index entries should be equal to number of documents in the collection
216 * 5. Except for sparse or partial indexes, num of index entries should not be lesser than
217 * num of docs in the collection
218 */
219
220 /*
221 * TODO Add document validations here
222 * 1. Check if the document conforms to the schema validation
223 * 2. Check if the document is corrupted
224 */
225}
226
227
228/*

Callers 1

command_validateFunction · 0.85

Calls 1

CheckIndisvalidFunction · 0.85

Tested by

no test coverage detected