[Developers] write execution question
Augusto Callejas
acallejas at appliedminds.com
Wed Jul 2 18:02:47 UTC 2008
hi-
i've sent variations of this question regarding implicit connnect directives
before, but here is a simplified version. the first write seems to create a
marriage link between two people if one doesn't already exist. so there
seems to be an implicit "connect" in the "spouse_s.spouse" portion of the
write. however, if i explicitly add the "connect" in the second write
below, it fails and says "Unique query may have at most one result. Got 2".
it seems like the first write says create a marriage link unless connected
to "Elizabeth Taylor" and "George Foreman". the second write seems to say
create a marriage link unless connected to "Elizabeth Taylor" and then
connect that link to "George Foreman", but since she has several marriage
links already, the write fails.
anyone at metaweb have insight into this?
thanks,
augusto.
===
{
"create" : "unless_exists",
"date_of_birth" : "1932-02-27",
"name" : "Elizabeth Taylor",
"spouse_s" : {
"create" : "unless_connected",
"spouse" : {
"name" : "George Foreman",
"type" : "/people/person"
},
"type" : "/people/marriage"
},
"type" : "/people/person"
}
===
===
{
"create" : "unless_exists",
"date_of_birth" : "1932-02-27",
"name" : "Elizabeth Taylor",
"spouse_s" : {
"create" : "unless_connected",
"spouse" : {
"connect" : "insert",
"name" : "George Foreman",
"type" : "/people/person"
},
"type" : "/people/marriage"
},
"type" : "/people/person"
}
===
More information about the Developers
mailing list