在我的收藏中,我应该为我的所有字段创建一个索引,还是为文档中的每个字段创建一个索引?
我的收藏:
{
"_id": ObjectId("53bfb3cd4109e65f728b4b53"),
"id_client": NumberLong(8667554),
"id_page": NumberLong(87664),
"id_campagne": NumberLong(646545),
"id_application": NumberLong(987987987987),
"id_groupe": NumberLong(2),
"year": NumberLong(2014),
"month": NumberLong(7),
"day": NumberLong(11),
"hour": NumberLong(8),
"uid": NumberLong(78658765),
"is_new_fan": NumberLong(0),
"creation_time": NumberLong(1405069193),
"is_player": NumberLong(1),
"total_request": NumberLong(0),
"total_share": NumberLong(0),
"ip": "NR",
"men": NumberLong(0),
"women": NumberLong(0),
"user_agent": "NR",
"players_desktop": NumberLong(0),
"players_mobile": NumberLong(0),
"players_tablet": NumberLong(0),
"players_iframe": NumberLong(0),
"13_17": NumberLong(0),
"18_24": NumberLong(0),
"25_34": NumberLong(0),
"35_44": NumberLong(0),
"45_54": NumberLong(0),
"55_64": NumberLong(0),
"65_plus": NumberLong(0),
"first_name": "yyyy",
"last_name": "xxxx",
"email": "mail@gmx.fr",
"phone": "NR",
"zipcode": "3497409",
"country": "NR",
"birthday": "NR",
"city": "fgromagne",
"address": "NR",
"state": "NR",
"optin": NumberLong(0),
"optin_partner": NumberLong(0),
"custom_field_1": "Guitares",
"custom_field_2": "NR",
"custom_field_3": "NR",
"univers": NumberLong(1)
}
以下是1个字段的1个索引的例子:
这里有许多字段的另一个例子1指数:
我将MongoDB与AWS EC2实例一起使用。 谢谢