[Developers] mqlwrite & implicit connnect directives pt2

Augusto Callejas acallejas at appliedminds.com
Thu Feb 28 21:26:30 UTC 2008


hi again-

just to verify that i'm thinking about this correctly, i have two very
similiar looking write queries.  the difference is that the second one has a
"connect":"insert" key-value pair in the "u" query.

focusing on the "t" query, the first one creates an instance of type
"/user/augusto/e/t" unless it finds one that has "name" with value
"doughnut" and has an instance of "u" with an "id" with value
"/guid/9202a8c04000641f80000000077104c4".

the second one creates an instance of type "/user/augusto/e/t" unless it
finds one that has "name" with value "doughnut" and after creating it,
connects it with an instance of "u" that has an "id" with value
"/guid/9202a8c04000641f80000000077104c4"?

can i generally say that "create":"unless_exists" will search for instances
based on properties whose values are either literal values (e.g. string,
integer, boolean) or are write queries without a "connect" or "create"
directive?

thanks,
augusto.

===
{
  "query" : {
    "id" : "/guid/9202a8c04000641f80000000077070ba",
    "t" : {
      "create" : "unless_exists",
      "name" : "doughnut",
      "type" : "/user/augusto/e/t",
      "u" : {
        "id" : "/guid/9202a8c04000641f80000000077104c4",
        "type" : "/user/augusto/e/u"
      }
    },
    "type" : "/user/augusto/e/s"
  }
}
===
{
  "query" : {
    "id" : "/guid/9202a8c04000641f80000000077070ba",
    "t" : {
      "create" : "unless_exists",
      "name" : "doughnut",
      "type" : "/user/augusto/e/t",
      "u" : {
        "connect":"insert",
        "id" : "/guid/9202a8c04000641f80000000077104c4",
        "type" : "/user/augusto/e/u"
      }
    },
    "type" : "/user/augusto/e/s"
  }
}
===




More information about the Developers mailing list