Mongodb does not support join, and your dbref is not in lazy loading mode, so when checking the archive, the user will also be found. You can use query statements such as hibernate's hsql to implement archive.title and archive.user, but you cannot query aechive.user.name alone. Mongodb is a non-relational database, which encourages field redundancy and query redundancy, so the situation you mentioned is really difficult to implement
Using the fields above, only one field can be missing, and the other fields are null. But the data of the joint table cannot be queried, because the Archive table stores the ID and table name of the joint table, so only the ID can be found here. , I tested it and directly checked the name of the joint table and reported an error. So, that’s it.
I encountered the same problem as you. I haven’t found a way to get only some fields in some DBRef objects. Same solution. For your problem, you can try the method in this article. My problem is a little more complicated than yours: http://blog.csdn.net/congcong...
Mongodb does not support join, and your dbref is not in lazy loading mode, so when checking the archive, the user will also be found.
You can use query statements such as hibernate's hsql to implement archive.title and archive.user, but you cannot query aechive.user.name alone.
Mongodb is a non-relational database, which encourages field redundancy and query redundancy, so the situation you mentioned is really difficult to implement
Using the fields above, only one field can be missing, and the other fields are null.
But the data of the joint table cannot be queried, because the Archive table stores the ID and table name of the joint table, so only the ID can be found here. , I tested it and directly checked the name of the joint table and reported an error. So, that’s it.
I encountered the same problem as you. I haven’t found a way to get only some fields in some DBRef objects. Same solution.
For your problem, you can try the method in this article. My problem is a little more complicated than yours:
http://blog.csdn.net/congcong...