草庐IT

azure-data-sync

全部标签

java - Spring Data + Mongo- 无分组字段求和

我有这样的匹配标准-Criteriacriteria=newCriteria().and("paidMobileMetadata").in(metadataList).and("localDate").gt(startDate).lte(endDate);现在我想得到字段的总和,说“钱”属于上述标准,而不对某些字段进行分组。早些时候我遇到了同样的问题,我必须在某个字段上对这个匹配标准进行分组,我是这样做的-Aggregationagg=Aggregation.newAggregation(Aggregation.match(newCriteria().and("paidMobileMe

python - 无法使用 mongodb 协议(protocol)支持在 azure document db 中列出集合

我目前正在使用Python3(pymongo)连接到支持Mongo协议(protocol)的Azure文档数据库。#referencetoconnectionstringself.connection_string="mongodb://:@:/?ssl=true"#createstheconnection(thisisworking)self.mongo_client=MongoClient(self.connection_string)#showdatabasesandtherecollectionsprint(self.mongo_client.database_names())

java - 如何配置两个实例mongodb使用spring boot和spring data

第一个实例是嵌入式MongoDb,第二个实例是实时MongoDb。它如何配置使用spring数据和spring引导。如何通过属性文件轻松切换这些实例??更新默认情况下,应用程序应该启动内置数据库并存储数据进入APPDIR/db目录应该可以让应用程序知道外部数据库将通过配置mongo.url属性使用。在这种情况下不需要启动内部数据库。而不是那个外部连接应该使用请粘贴一些配置。更新我有:de.flapdoodle.embedde.flapdoodle.embed.mongo1.50.5spring.data.mongodb.host=localhostspring.data.mongodb

mongodb - Azure DocumentDB Local Emulator 是否支持 mongodb 协议(protocol)?

AzureDocumentDB本地模拟器是否支持与Azure托管DocumentDB中可用的MongoDB协议(protocol)类似的mongodb协议(protocol)?在启动本地模拟器时,我没有看到指定协议(protocol)的方法。 最佳答案 是的,AzureDocumentDB模拟器支持MongoDBAPI。它默认在端口10250上监听。在此处查看如何从MongoDB应用程序连接到模拟器:https://learn.microsoft.com/en-us/azure/documentdb/documentdb-nosql

java - Spring Boot 1.5.1,Spring Data MongoDB 存储库没有合格的 bean

在我的SpringBoot1.5.1项目中,我添加了以下Maven依赖项:org.springframework.bootspring-boot-starter-data-mongodb并创建了一个SpringDataMongoDB存储库:packagecom.example.domain.repository.decision.parameter;@RepositorypublicinterfaceCustomerRepositoryextendsMongoRepository{}这是我的模型:@Document(collection="decision_analysis_param

MongoDB Robomongo : db. data.find(...).collat​​ion 不是函数

我正在尝试运行:db.data.find({email:'random@test.com'}).collat​​ion({locale:'en'})但我一直收到.collat​​ionisnotafunction。我使用的脚本有误吗?谢谢。 最佳答案 MongoDB3.4引入了'Collat​​ion'。现在可以使用带有最新测试版的MongoDB3.4:Robomongo1.1-BetaversionwithMongoDB3.4Support.仅供引用。 关于MongoDBRobomon

mongodb - Azure CosmosDB 使用 Mongo 驱动程序 : Get Count With out getting all documents based on element in sub sub document in C#.Net

下面是我存储在AzureMongoDB中的JSON结构(粘贴了示例结构),我想使用Plyrs中存在的userID元素进行查询(SubSubdocument)以获取用户参加过的所有锦标赛的列表。我尝试过使用Aggregate()但没有成功。请纠正我如果我遗漏了什么,下面是它的代码。尝试使用构建器但没有成功,使用构建器我能够检索到一个级别(子集合,json(粘贴在下面)引用高达tbls)在那里我可以在Plyrs(子子集合)上查询的任何方式。AzureMongoDB是否支持Aggregate()或不获取整个文档的计数?请指导我聚合varcount=sampleMongoDataBase.Ge

java - 无法将聚合查询从 mongodb 转换为 Spring Data MongoDb

我在尝试使用聚合对象将我在mongodb中的查询转换为SpringDataMongoDb时遇到了问题。我在mongo中有以下文档:{"_id":ObjectId("596ce468798b61179c6442bb"),"_class":"com.test.model.User","name":"Oi","surName":"Alo","workLogs":[{"_id":ObjectId("596ce468798b61179c6442bc"),"day":1,"month":1,"year":2017,"timeEntrance":"8:00","lunchLeave":"12:00"

mongodb - @PrePersist EventListener spring-data-mongo 的替代品

我创建了一个Repository来自动增加@Document的id但现在我需要显式调用@Idsetter方法来设置新的ID。有没有一种方法可以使用JPA@PrePersist中的监听器来做到这一点@RepositoryinterfaceUserRepository:MongoRepository,UserRepositoryCustominterfaceUserRepositoryCustom{funsave(user:User):User}classUserRepositoryImpl(privatevalmongoOperations:MongoOperations,private

mongodb - 从 Azure MongoDB 导出集合

所以我在AzureCosmosDB服务中有一个MongoDB。它包含1500个文档的集合,我想以JSON格式下载整个集合。我尝试了几种方法都没有成功,即test_collection.find({})这给了我一个游标超时。使用{timeout:false}没有帮助。然后我尝试使用mongoexport:mongoexport-hhost_name--port1234-uuser_name-ppassword-dadmin-ccollection_name-odata.json--ssl这给了我0个导出记录。防火墙IP访问控制已关闭,我可以通过Mongoshell连接到数据库。尝试导出其