{"action":"created","issue":{"url":"https://api.github.com/repos/byzhang/leveldb/issues/42","labels_url":"https://api.github.com/repos/byzhang/leveldb/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/byzhang/leveldb/issues/42/comments","events_url":"https://api.github.com/repos/byzhang/leveldb/issues/42/events","html_url":"https://github.com/byzhang/leveldb/issues/42","id":59730074,"number":42,"title":"add support for PutNew/3 and WriteNew/2 update operations","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/byzhang/leveldb/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/byzhang/leveldb/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/byzhang/leveldb/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-04T00:16:22Z","updated_at":"2015-03-04T00:16:23Z","closed_at":"2015-03-04T00:16:23Z","body":"```\nIt would be handy to have 2 new update operations that fail if the key(s) \nalready exist in the database.  \n\nFor WriteNew operations, the last key/value of the batch is stored and not \nconsidered as already exists when a duplicate key(s) are given in the batch.\n\n\n  // Set the database entry for \"key\" to \"value\" only if \"key\" does not exist.  Returns OK on success,\n  // and a non-OK status on error.\n  // Note: consider setting options.sync = true.\n  virtual Status PutNew(const WriteOptions& options,\n                     const Slice& key,\n                     const Slice& value) = 0;\n\n\n  // Apply the specified updates to the database only if all keys do not exist (prior to this operation).\n  // Returns OK on success, non-OK on failure.\n  // Note: consider setting options.sync = true.\n  virtual Status WriteNew(const WriteOptions& options, WriteBatch* updates) = 0;\n```\n\nOriginal issue reported on code.google.com by `josephwn...@gmail.com` on 27 Sep 2011 at 2:32"},"comment":{"url":"https://api.github.com/repos/byzhang/leveldb/issues/comments/77070435","html_url":"https://github.com/byzhang/leveldb/issues/42#issuecomment-77070435","issue_url":"https://api.github.com/repos/byzhang/leveldb/issues/42","id":77070435,"user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T00:16:23Z","updated_at":"2015-03-04T00:16:23Z","body":"```\nI am not sure I understand this one. leveldb is a LSM based database. It writes \nnew kvs to a new location and garbage collects overwritten ones. If you want an \napi that implements read-modify-writes can you implement it in your own \napplication?\n\nare you concerned about the atomicity of the read-modify-write operation?\n```\n\nOriginal comment by `dhr...@gmail.com` on 26 May 2012 at 5:12"}}