Index: library/mongodb/example-nx-reference-one.tcl =================================================================== diff -u -ra77464d1f7a06117c621560ec519dc4d387ed5df -r42ba8471f7620b850b6296f753cbc3079fe5c6cd --- library/mongodb/example-nx-reference-one.tcl (.../example-nx-reference-one.tcl) (revision a77464d1f7a06117c621560ec519dc4d387ed5df) +++ library/mongodb/example-nx-reference-one.tcl (.../example-nx-reference-one.tcl) (revision 42ba8471f7620b850b6296f753cbc3079fe5c6cd) @@ -30,7 +30,7 @@ # Retrieve the entry from the database: set p [Post find first -cond {title = "Hello trivial World"}] -puts stderr "Name of user: [$p user]\n" +puts stderr "Name of user: [$p cget -user]\n" ###################################################################### # The second approach to implement references to other objects via an @@ -54,8 +54,8 @@ # Retrieve the entry from the database: set p [Post find first -cond {title = "Hello simple World"}] -set u [User find first -cond [list _id = [$p user_id]]] -puts stderr "Name of user: [$u name]\n" +set u [User find first -cond [list _id = [$p cget -user_id]]] +puts stderr "Name of user: [$u cget -name]\n" ###################################################################### # The third approach is to embed the object in the referencing @@ -75,7 +75,7 @@ # Retrieve the entry from the database: set p [Post find first -cond {title = "Hello embedded World"}] -puts stderr "Name of user: [[$p user] name]\n" +puts stderr "Name of user: [[$p cget -user] cget -name]\n" ###################################################################### # The fourth approach is to use mongo db-refs for referencing. This @@ -101,7 +101,7 @@ # Retrieve the entry from the database: set p [Post find first -cond {title = "Hello referenced World"}] - puts stderr "Name of user: [[$p user] name]\n" + puts stderr "Name of user: [[$p cget -user] cget -name]\n" puts stderr "Content of the collection groups:" Post show