* validateCollection is the internal implementation for validating a collection. */
| 199 | * validateCollection is the internal implementation for validating a collection. |
| 200 | */ |
| 201 | static void |
| 202 | validateCollection(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 | /* |
no test coverage detected