I am new in MongoDB.
I am programming an application with spring data and mongodb and I have one class with two fields: firstname
and lastname
.
I need one query for documents that contain one string in the full name (firstname
+ lastname
).
For example: firstname = "Hansen David"
, lastname = "Gonzalez Sastoque"
and I have a query to find David Gonzalez
. In this example I expect there to be a match.
Concatenate two strings solves it but I don't know how to perform this.