Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!

Aca Vidak

Greenhorn
+ Follow
since Oct 06, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Aca Vidak

Hi everyone,

I need advice on doing manual references in mongodb with spring without using dbrefs.

If for example, I have two document collections:

User {
...
addresses: [addressId1, addressId2...]
}

Address {
..
}

So, user has 1 or more addresses. In user document, I want to use array of address ids.

Now, there is a question of inserting, updating and retrieving user document.

For insertion, I would need one POJO which has addresses as array of ids (array of ObjectIds, Strings..).

For retrieving, sometimes I need full document with addresses eagerly populated. For this case I would need different POJO which has addresses as array of address objects.

Is there any good approach to this? Any pieces of advice?
2 weeks ago