Skip to content

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:…

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: sp…

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