Skip to content
Advertisement

Tag: mongodb

Regex query in spring boot mongoDB on integer

My data schema in mongoDB { } I want to query on itemId such that if (In my database itemId is (1,2,12 , 13 , 15 27) ) if i search for itemId 1 then it fetch data start from 1 mean fetch data of itemId(1,12,13,15) if i am not pass itemId then fetch whole data. Please help me thanks

Spring boot Mongo DB .yml configuration

When I use MySQL and hibernate for spring boot, I use below configuration in .yml file If it is mongoDB instead of MySQL and hibernate how does it change? Answer The mongodb properties are all prefixed with spring.data.mongodb. For user property you would use The list of available mongodb properties are here: You can find them at source for how

Connect Spring MVC with aws documentDB

I’m using mongoDB with aws ec2 instance it’s working fine and I’ve moved mongoDB to aws documentDB, So i’m not able to connect documentDB with same code, So any one can u please help me if you have idea. Here is my connection code in Spring MVC: Spring, Hibernet and mongoDB version: spring -4.2.5 spring-data-MongoDB -1.10.14 mongo-java-driver -3.5.0 Answer To

MongoDB how to count array elements with Java driver

I need my application to count the size of an array foos inside a document using Java driver 3.8. I know I can do this with the shell but I have no idea of how to do this with java, because the only method producing a $size operator I found is Filters.size(String fieldName, int size) that is meant to look

Spring Data MongoDB 4.0 transactions support

MongoDB 4.0 are going to introduce transactions support with ACID guarantees. Does Spring Data MongoDB already supports the transactions in MongoDB and if no, when this awesome feature will be available. I really need it, taking into account the following issue – MongoDB schema design in order to support application horizontal scaling Answer Does Spring Data MongoDB already supports the

How to add to an existing MongoDB Bson Filter in Java

I’m using MongoDB 3.6.3 and the 3.6.0 Mongo & Bson drivers for Java. Given the following filter: I need to conditionally add another field to filter, effectively making it: Is there a way to do this by appending that field to filter, or do I have to create the filters separately? eg. Answer Filters.and() returns an instance of the private

Advertisement