22#include "mongo/client/export_macros.h"
38 kIndexTypeGeoHaystack,
39 kIndexTypeGeo2DSphere,
44 static const int kIndexValAscending = 1;
45 static const int kIndexValDescending = -1;
46 static const char kIndexValText[];
47 static const char kIndexValGeo2D[];
48 static const char kIndexValGeoHaystack[];
49 static const char kIndexValGeo2DSphere[];
50 static const char kIndexValHashed[];
72 typedef std::vector<std::pair<std::string, IndexType> >
KeyVector;
105 MONGO_CLIENT_DEPRECATED(
"deprecated in MongoDB 2.8")
138 IndexSpec& textDefaultLanguage(const StringData& value);
141 IndexSpec& textLanguageOverride(const StringData& value);
199 std::
string name() const;
BSONElement represents an "element" in a BSONObj.
Definition bsonelement.h:55
Utility for creating a BSONObj.
Definition bsonobjbuilder.h:53
C++ representation of a "BSON" object – that is, an extended JSON-style object in a binary representa...
Definition bsonobj.h:78
Definition index_spec.h:29
IndexSpec()
Create a new IndexSpec.
IndexSpec & background(bool value=true)
Controls whether this index should be built in the foreground or background.
IndexSpec & name(const StringData &name)
Set the name for this index.
IndexSpec & addKey(const StringData &field, IndexType type=kIndexTypeAscending)
Add a new component, by default ascending, field to index.
std::vector< std::pair< std::string, IndexType > > KeyVector
Add all components in the provided key vector to the index descriptor.
Definition index_spec.h:72
IndexSpec & addKeys(const BSONObj &keys)
Add all keys from the provided object to the index descriptor.
IndexSpec & addKey(const BSONElement &fieldAndType)
Add a component to this index.
IndexSpec & unique(bool value=true)
Set whether or not this index should enforce uniqueness.
the main MongoDB namespace
Definition bulk_operation_builder.h:24