简体   繁体   中英

Regex query in spring boot mongoDB on integer

My data schema in mongoDB

{

 id:type(string),
 itemId:type(int),
 itemName:type(string)

}

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 in advance

To solve this problem i store all itemId in string and build like query.

Thanks for support

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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