ALL COVERED TOPICS

NoSQL Benchmarks NoSQL use cases NoSQL Videos NoSQL Hybrid Solutions NoSQL Presentations Big Data Hadoop MapReduce Pig Hive Flume Oozie Sqoop HDFS ZooKeeper Cascading Cascalog BigTable Cassandra HBase Hypertable Couchbase CouchDB MongoDB OrientDB RavenDB Jackrabbit Terrastore Amazon DynamoDB Redis Riak Project Voldemort Tokyo Cabinet Kyoto Cabinet memcached Amazon SimpleDB Datomic MemcacheDB M/DB GT.M Amazon Dynamo Dynomite Mnesia Yahoo! PNUTS/Sherpa Neo4j InfoGrid Sones GraphDB InfiniteGraph AllegroGraph MarkLogic Clustrix CouchDB Case Studies MongoDB Case Studies NoSQL at Adobe NoSQL at Facebook NoSQL at Twitter

NAVIGATE MAIN CATEGORIES

Close

CouchDB: Auto Increment IDs with PHP

Sounds like auto incrementing IDs is something that NoSQL databases users are needing. Aravinda has posted a solution for getting auto incementing IDs in CouchDB:

As of now, PHP function involves two http calls for adding single document. Let me know if you find any ways to reduce it to one http call.

But as pointed out by a commenter, unfortunately the proposed solution is not re-entrant. As far as I can tell there’s a way to get UUIDs from CouchDB, but the values will not be incremental, not sure if even ordered:

curl -X GET <a href='#' rel='external nofollow'>http://127.0.0.1:5984/_uuids?count=10</a>

Original title and link: CouchDB: Auto Increment IDs with PHP (NoSQL databases © myNoSQL)

via: http://aravindavk.in/blog/couchdb_auto_increment_ids_with_php