db.getCollection(“ProductBuriedPointPo”).find();–查询
db.getCollection(“ProductBuriedPointPo”).remove({“_id”: ObjectId(“61e8f4c3bdc4381042acd296”)})–删除
db.getCollection(“ProductBuriedPointPo”).insert( {
_id: ObjectId(“61e8f4c3bdc4381042acd299”),
userId: “userId1”,
token: “token”,
stopTime: “1”,
refererPageID: “1”,
refererPageName: “精品推荐”,
currentPageID: “4”,
currentPageName: “产品详情”,
coreVersion: “火狐”,
os: “操作系统”,
clickCount: “2”,
type: “1”,
typeName: “广告监测”,
eventId: “1-精选推荐-顶部轮播广告位”,
eventName: “精选推荐-顶部轮播广告位”,
productCode: “产品编码”,
advertId: “广告id”,
brandId: “品牌id”,
companyId: “企业id”,
createdDate: “2022-01-20 13:36:02”,
_class: “com.guoke.m.etl.pojo.po.mongo.ProductBuriedPointPo”} );–插入
db.getCollection(“ProductBuriedPointPo”).update( { _id: ObjectId(“61e8f4c3bdc4381042acd295”) }, {
_id: ObjectId(“61e8f4c3bdc4381042acd295”),
userId: “userId1”,
token: “token”,
stopTime: “1”,
refererPageID: “1”,
refererPageName: “精品推荐”,
currentPageID: “4”,
currentPageName: “产品详情”,
coreVersion: “火狐”,
os: “操作系统”,
clickCount: “2”,
type: “1”,
typeName: “广告监测”,
eventId: “1-精选推荐-顶部轮播广告位”,
eventName: “精选推荐-顶部轮播广告位”,
productCode: “产品编码”,
advertId: “广告id”,
brandId: “品牌id”,
companyId: “企业id”,
createdDate: “2022-01-20 13:36:02”,
_class: “com.guoke.m.etl.pojo.po.mongo.ProductBuriedPointPo”
} );–更新
ConvertOperators.ToDate
Convert.toInt()//MongoDB代码中是字符串与数据库中int类型对比