For one-to-one associations we persist an array for the main side rather than a single JSON property in MongoDB (and probably CouchDB as well). Taking {{OneToOneTest#testBidirectionalManyToOne()}} as an example, that's the actual vs. the expected persisted format:
{code} { "_id" : "6866afaf-c5ee-4fee-9821-79b2ae2a63b7", "husband" : [ "ae25fe38-d532-415c-b12a-4c1f0f4782a8" ], "name" : "Bea" } { "_id" : "ae25fe38-d532-415c-b12a-4c1f0f4782a8", "name" : "Alex", "wife" : "6866afaf-c5ee-4fee-9821-79b2ae2a63b7" } {code}
vs.
{code} { "_id" : "6866afaf-c5ee-4fee-9821-79b2ae2a63b7", "husband" : "ae25fe38-d532-415c-b12a-4c1f0f4782a8", "name" : "Bea" } { "_id" : "ae25fe38-d532-415c-b12a-4c1f0f4782a8", "name" : "Alex", "wife" : "6866afaf-c5ee-4fee-9821-79b2ae2a63b7" } {code}
|