Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Document possible design docs #1

Open
srl295 opened this issue Jun 3, 2017 · 0 comments
Open

Document possible design docs #1

srl295 opened this issue Jun 3, 2017 · 0 comments

Comments

@srl295
Copy link
Contributor

srl295 commented Jun 3, 2017

{
  "_id": "_design/timeview",
  "views": {
    "timeview": {
      "map": "function (doc) {\n  if(doc.time) {\n    var d = new Date(doc.time);\n    emit([d.getFullYear(),d.getMonth()+1,d.getDate(),doc._id], doc.msg);\n  }\n}"
    }
  },
  "language": "javascript"
}

gives

{
 "id": "8fa21dfb2ac459c62d9be61afc1c5435",
 "key": [
  2017,
  4,
  26,
  "8fa21dfb2ac459c62d9be61afc1c5435"
 ],
 "value": "Startup OK!",
 "_id": "8fa21dfb2ac459c62d9be61afc1c5435"
}

Of course you might want time as well as day.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant