-
Notifications
You must be signed in to change notification settings - Fork 1.1k
DATAMONGO-2215 - Add support for array filters to Update. #656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We now support the $[] array update operator when mapping Update.
We now support filtered positional $[<identifier>] operator via Updates. This allows to specify a filter criteria chain for the elements in an array. new Update() .set("grades.$[element]", 100) .filterArray(Criteria.where("element").gte(100)); Array filters can be used for MongoOperations#update* & MongoOperations#findAndMofify
f474690
to
f73258b
Compare
We now support filtered positional $[<identifier>] operator via Updates. This allows to specify a filter criteria chain for the elements in an array. new Update() .set("grades.$[element]", 100) .filterArray(Criteria.where("element").gte(100)); Array filters can be used for MongoOperations#update* & MongoOperations#findAndModify Original pull request: #656.
Update Javadoc to reflect that array filters are used in their raw form without domain-type related type- or field mapping. Original pull request: #656.
That's merged and polished now. |
not able to use arrayFilters with update |
getting error like add cast to receiver |
@mp911de |
We do not backport features, also the change is not compatible because 1.x uses the DBObject API. 1.x goes end of life in August. Please upgrade to the 2.x line. |
No. Native queries (command documents) are assembled by the driver depending on the functionality that should be used. We're using a higher-level API to invoke e.g. find operations instead of using the |
How can I use this dependency with spring boot 2.1.4.Release, As soon as I add this jar via maven shaded plugin, It shows me other errors where it is not able to fetch something from org.springframework.data.* |
Can we use two identifiers with this change. If yes how to write equivalent spring-data-mongodb query for the below query: |
@vruddhishah I am using spring-boot 2.2.0.M4 , I am looking into using identifier which I believe was added as mentioned by christophstrobl. For more details, please refer the below link |
As per your question, it seemed like you are searching for equivalent spring-data-mongodb query. Hence the relevant reference link was provided. But after the additional information provided, I understand your question now!! Thanks |
spring-data-mongodb 2.2.1版本以下的,可以使用BasicBSONObject里的基础方法来支持filterArray方法: `/**
String code; /**
/**
} /**
} |
@caryfang if there's an issue related to this ticket please care to open a new one and please do spend some time describing it. Ideally take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem. |
We now support filtered positional
$[<identifier>]
operator viaUpdates
. This allows to specify a filter criteria chain for the elements in an array.Depends on: #653 (DATAMONGO-2054)