سؤال

The BaseX documentation uses the word "collection" in a way that makes its meaning unclear. Is a collection simply another word for a database, or is it a distinct construct? If the latter, what commands are used to manipulate collections?

هل كانت مفيدة؟

المحلول

About Collections and Databases

The XQuery documentation does not speak about databases, but collections - thus there is the name collection to conform to the specs. Yet the specification does not define what a collection is, this is implementation dependent. While other systems like Marklogic allow multiple collections in a database, BaseX regards one collection as a single database.

From the BaseX Documentation Wiki:

In BaseX, a database is a pretty light-weight concept and can be compared to a collection. It contains an arbitrary number of resources, addressed by their unique database path.

It is easy and a cheap operation to join over documents from multiple collections/databases, so split up as seams reasonable to you. Actually using multiple databases instead of one can have a positive effect on concurrency.

Managing Databases in BaseX

Databases are managed using BaseX Commands.

Most of interest will be

Managing Databases Using XQuery

For some operations there are also BaseX-specific XQuery-functions in the Database Module, but using them is somewhat restricted by XQuery Update's Pending Update List.

Disclaimer: I'm somewhat involved within the BaseX team.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top