skip to Main Content

Spring Data mongodb like query

I want to make a text search case insensitive with regex query with spring-data mongo . For example in SQL: SELECT * FROM Customers WHERE CustomerName LIKE 'a%'; How can i make this query with spring-data mongo using MongoRepository Query…

VIEW QUESTION

checking if a value exists in mongodb collection using pymongo

I have a a mongo db table in the following format [{"url":"www.example1.com", "name":"hans","age":30}, {"url":"www.example2.com", "name":"x","age":34}, {"url":"www.example3.com", "name":"y","age":35}, {"url":"www.example4.com", "name":"z","age":36}, {"url":"www.example5.com", "name":"b","age":37}] I have two tables where i need to check for under two if conditions. I did in the following…

VIEW QUESTION

How to find_one in mongodb if the key is not always present?

I have a following mongodb: some records looks like {'_id': ObjectId('62790ce20375a639af1d8676'), 'visit_id': 594817704, 'transaction' : 10} some has only this form: {'_id': ObjectId('62790ce20375a639af1d8679'), 'visit_id': 594817704} Using this code I can search for all collections that consists of transaction_id: collection.find({'transaction_id': {…

VIEW QUESTION
Back To Top
Search