Skip to content

Collection name / ID generator #591

@Mangatt

Description

@Mangatt

I think it would be useful to officially expose collection name and id generator on collection object:

const collection = db.collection("collection");
console.log(collection.name); // collection

This is right now undocumented feature and thus not realiable for use in production. It is useful for generating ID from _key:

const id = collection.name + '/' + _key

Maybe it would be worth to even include specialized method for this:

const id = collection.getID("documentID")
console.log(id); // collection/documentID

Metadata

Metadata

Assignees

Labels

Feature RequestRequest for new functionality to be added to the driver.fixedIssue has been resolved but remains open due to a pending release.semver-minorThis issue does not require any backwards-incompatible changes to address.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions