tested and made consistent with couchdb implementation
of requires