I'm trying to create a MongoDB index on a specific field with the following input:
Collection: messages
source_id (integer)
message_id (string)
subject (string)
timestamp (integer)
I'm in need to query this collection on the source and uid fields.
Example document:
{
"_id" : ObjectId("53aad315bffebc5d378b4569"),
"source_id" : NumberLong(1),
"message_id" : "AMA9D2TP9zWA.kuhlman.lowell@dietrich.com",
"subject" : "Labore aut est amet temporibus mollitia et.",
"timestamp" : NumberLong(1364645191)
}
A simple db.messages.getIndexes() returns that my message_id index is a NumberLong?
> db.messages.getIndexes()
[
{
"v" : 1,
"name" : "_id_",
"key" : {
"_id" : 1
},
"ns" : "hs.messages"
},
{
"v" : 1,
"name" : "s_1",
"key" : {
"s" : NumberLong(1)
},
"ns" : "hs.messages"
},
{
"v" : 1,
"name" : "m_1",
"key" : {
"m" : NumberLong(1)
},
"ns" : "hs.messages"
}
]