Storage Engine API
index_key_validate.h
Go to the documentation of this file.
1 
29 #pragma once
30 
31 #include "mongo/db/index/index_descriptor.h"
32 #include "mongo/db/server_options.h"
33 
34 namespace mongo {
35 class BSONObj;
36 class CollatorInterface;
37 class NamespaceString;
38 class Status;
39 template <typename T>
40 class StatusWith;
41 
42 namespace index_key_validate {
43 
48 Status validateKeyPattern(const BSONObj& key, IndexDescriptor::IndexVersion indexVersion);
49 
56  OperationContext* opCtx,
57  const BSONObj& indexSpec,
58  const NamespaceString& expectedNamespace,
59  const ServerGlobalParams::FeatureCompatibility& featureCompatibility);
60 
65 Status validateIdIndexSpec(const BSONObj& indexSpec);
66 
71 Status validateIndexSpecFieldNames(const BSONObj& indexSpec);
72 
79  const BSONObj& indexSpec,
80  const CollatorInterface* defaultCollator);
81 
82 } // namespace index_key_validate
83 } // namespace mongo
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
OperationContext Database StringData BSONObj CollectionOptions::ParseKind bool const BSONObj &idIndex Status
Definition: database_impl.cpp:956
StatusWith< BSONObj > validateIndexSpecCollation(OperationContext *opCtx, const BSONObj &indexSpec, const CollatorInterface *defaultCollator)
Validates the &#39;collation&#39; field in the index specification &#39;indexSpec&#39; and fills in the full collatio...
Definition: index_key_validate.cpp:471
BSONObj key
Definition: btree_interface.cpp:334
Status validateIdIndexSpec(const BSONObj &indexSpec)
Performs additional validation for _id index specifications.
Definition: index_key_validate.cpp:423
IndexDescriptor::IndexVersion IndexVersion
Definition: collection_compact.cpp:52
Status validateKeyPattern(const BSONObj &key, IndexDescriptor::IndexVersion indexVersion)
Checks if the key is valid for building an index according to the validation rules for the given inde...
Definition: index_key_validate.cpp:103
Definition: index_key_validate.h:40
StatusWith< BSONObj > validateIndexSpec(OperationContext *opCtx, const BSONObj &indexSpec, const NamespaceString &expectedNamespace, const ServerGlobalParams::FeatureCompatibility &featureCompatibility)
Validates the index specification &#39;indexSpec&#39; and returns an equivalent index specification that has ...
Definition: index_key_validate.cpp:212
Collection *const OperationContext *const opCtx
Definition: collection_impl.cpp:80
Status validateIndexSpecFieldNames(const BSONObj &indexSpec)
Top-level index spec field names are validated here.
Definition: index_key_validate.cpp:453