Relational Model and CODD Rules
SetRowAttrs
Spec:
SetRowAttrs(<FIELD>, <ROW>,
<ATTR_NAME=ATTR_VALUE>,
[ATTR_NAME=ATTR_VALUE ...])
Description:
SetRowAttrs
associates arbitrary key/value pairs with a row in a field. Setting a value of null
, without quotes, deletes an attribute.
Result Type: null
SetRowAttrs queries always return null
upon success.
Examples:
Set attributes username
and active
on row 10:
SetRowAttrs(stargazer, 10, username="mrpi", active=true)
{"results":[null]}
Set username value and active status for user 10. These are arbitrary key/value pairs which have no meaning to Pilosa. You can see the attributes you’ve set on a row with a Row query like so Row(stargazer=10)
.
Delete attribute username
on row 10:
SetRowAttrs(stargazer, 10, username=null)
{"results":[null]}
SetColumnAttrs
Spec:
SetColumnAttrs(<COLUMN>,
<ATTR_NAME=ATTR_VALUE>,
[ATTR_NAME=ATTR_VALUE ...])
Description:
SetColumnAttrs
associates arbitrary key/value pairs with a column in an index.
Result Type: null
SetColumnAttrs queries always return null
upon success. Setting a value of null
, without quotes, deletes an attribute.
Examples:
Set attributes stars
, url
, and active
on column 10:
SetColumnAttrs(10, stars=123, url="http://projects.pilosa.com/10", active=true)
{"results":[null]}
Set url value and active status for project 10. These are arbitrary key/value pairs which have no meaning to Pilosa.
ColumnAttrs can be requested by adding the URL parameter columnAttrs=true
to a query. For example: