I would like to be able to create a query/query-expression that I can use in SprinXD MongoDB Source module to return only the last document that has been inserted.
It seems that max-messages-per-poll doesn't do the trick (paginated data with the help of mongo inbound adapter in spring integration)
I know how to do it with agreggation, findOne(), limit(), etc, but I haven't found a way to do it with a query object.
My stream is the following:
mongodb --collectionName=Notifications --fixedRate=10000 --query={'$query':{}},{'$limit':1} | log
But I'm still returning all the documents.
Any help is appreciated.
Thanks, David