I was wondering if spring data for MongoDB could handle multiple databases and perform cross database queries and inserts.
for example if I want to store EntityA
in DB dbA
and EntityB
in dbB
and EntityA
has a reference to EntityB
, will Spring Data generate the correct DBRef
pointing to the correct collection and the correct database ?
Will I then be able to query EntityA
and then eventually lazy fetch EntityB
?
Morphia lacks this functionality alongside other things, and I was wondering if Spring data had it before making the big dive and ditching Morphia.