mongDB的相关查询插入操作

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类型对比

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值