简体   繁体   English

SpringBoot MongoDB插入测试数据库

[英]SpringBoot MongoDB inserting into test database

I have a simple SpringBoot Application which does the CRUD operations using mongodb i have used the following application.properties :- 我有一个简单的SpringBoot应用程序,它使用mongodb进行CRUD操作,我使用了以下application.properties:-

spring.data.mogodb.host=localhost
spring.data.mogodb.port=27017
spring.data.mogodb.database=EmulationDb

ideally it should insert the documents in EmulationDb, but it is inserting in the test db, can any one suggest what went wrong. 理想情况下,它应该将文件插入EmulationDb中,但是要插入到测试数据库中,任何人都可以建议出了什么问题。

Try using this property and see if it works: 尝试使用此属性,看看它是否有效:

spring.data.mongodb.uri=mongodb://localhost:27017/EmulationDb

edit 编辑

just noticed you have a typo in your properties: mogodb instead of mongodb (missing n ) 刚刚注意到您的属性中有错别字: mogodb而不是mongodb (缺少n

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM