22#include "mongo/client/export_macros.h"
37 kIndexTypeGeoHaystack,
38 kIndexTypeGeo2DSphere,
43 static const int kIndexValAscending = 1;
44 static const int kIndexValDescending = -1;
45 static const char kIndexValText[];
46 static const char kIndexValGeo2D[];
47 static const char kIndexValGeoHaystack[];
48 static const char kIndexValGeo2DSphere[];
49 static const char kIndexValHashed[];
71 typedef std::vector<std::pair<std::string, IndexType> >
KeyVector;
104 MONGO_CLIENT_DEPRECATED(
"deprecated in MongoDB 2.8")
200 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:71
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.
A StringData object wraps a 'const string&' or a 'const char*' without copying its contents.
Definition string_data.h:43
Utility functions for parsing numbers from strings.
Definition compare_numbers.h:20