cq

MongDB日常操作

拜拜、爱过 提交于 2019-11-29 00:42:34
记录下日常的MongoDB操作命令: //新建库 use iceportal_image //新建collection db.createCollection("xxx-acc",{autoIndexId : true}) ; db.createCollection("xxx-img",{autoIndexId : true}) ; //插入数据 db.getCollection("xxx-img").insert( {_id:ObjectId(), xxId:"xxx21749", caption:"GT", nameZh:"大唐", nameEn:"xs", category:"xss", xxxCode:"STSSW", url:"/xme/bb", imageName:"xss", extension:".jpg", specs:"12x15", isDefault:"1", publicId:"64556", fileHashCode:"32666", isDeleted:"1", createTime:ObjectId("5349b4ddd2781d08c09890f4").getTimestamp(), updateTime:ObjectId("5349b4ddd2781d08c09890f4").getTimestamp() } ) db.getCollection