随笔分类 - MongoDB
摘要:Mongo语法 类比mysql中的一些用法,记录mongo用法 1、查询部分字段 字段标注不为0则取该字段,为0则不取,_id字段默认取,除_id外不同字段标注值必须相同 db.getCollection('doctor').find({},{name:1,_id:0}) 2、给字段起别名 聚合操作
阅读全文
摘要:SpringData中对mongoDB提供了支持,除了template方法外,还支持jpa格式的Repository. <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-d
阅读全文