Open gr2m opened 11 years ago
@caolan this one is a blocker, because I cannot differentiate between the different types.
type
& name
are there now. What about the _id
attribute? Did you leave it out on purpose?
Well, the id would be the same as name in this case. do you think we should also have the id property?
On 2 August 2013 12:28, Gregor Martynus notifications@github.com wrote:
type & name are there now. What about the _id attribute? Did you leave it out on purpose?
— Reply to this email directly or view it on GitHubhttps://github.com/hoodiehq/hoodie-plugins-api/issues/8#issuecomment-22000155 .
I mean the original CouchDB _id
attribute, do you leave it out on purpose?
in hoodie.js, I set id
to the uuid only. Shall we do the same for the worker API?
So if the user doc looks like this:
{
"_id": "org.couchdb.user:user/test",
"_rev": "3-066bdcd1e13b91533ec8b17e0926459e",
"name": "user/test",
"type": "user",
"roles": [
],
"ownerHash": "1132235",
"database": "user/1132235",
"updatedAt": "2013-08-02T11:28:51.741Z",
"createdAt": "2013-08-02T11:28:51.741Z",
"signedUpAt": "2013-08-02T11:28:51.741Z"
}
the passed object to a change handler would be
{
"_rev": "3-066bdcd1e13b91533ec8b17e0926459e",
"name": "user/test",
"type": "user",
"id": "test",
"roles": [
],
"ownerHash": "1132235",
"database": "user/1132235",
"updatedAt": "2013-08-02T11:28:51.741Z",
"createdAt": "2013-08-02T11:28:51.741Z",
"signedUpAt": "2013-08-02T11:28:51.741Z",
"derived_key": "65ec0624e84ef73d53fc45339ccf4c8d81836cad",
"salt": "c31a6326d781c889226cff452bbdf699"
}
I think we can also leave out the name
property, right?
I se a potential problem if people will want to set a custom name property, but it's a problem when it's a problem.
I think that for custom properties on _users docs I'd use a special $properties
property or something, and enforce that with a _design doc, so that they can't mess things up.
passed object looks like this:
note that both
type
&name
are undefined, but they shouldn't.Also note that there is no
_id
attribute.