mongodb脚本创建
db.createCollection("express_track");
db.getCollection("express_track").createIndex({
mailNo: NumberInt("1")
}, {
name: "mailNo_1"
});
db.getCollection("express_track").createIndex({
createTime: NumberInt("1")
}, {
name: "createTime_1",
expireAfterSeconds: NumberInt("15759360")
});
db.createCollection("log_events");
db.getCollection("log_events").createIndex({
createTime: NumberInt("1")
}, {
name: "createTime_1",
expireAfterSeconds: NumberInt("7879680")
});
db.createCollection("expressTrackRecord");
增删改查
db.express_track.find({'mailNo':'AE120000242648'});
db.express_track.find();
db.express_track.deleteOne({_id:ObjectId("628b5775ed2ee213b84395b3")});
db.express_track.find({mailNo:'AE120000086328'});