Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some data structure changes #119

Open
wants to merge 1 commit into
base: release/1.7
Choose a base branch
from

Conversation

RichardSmedley
Copy link
Contributor

No description provided.

Data structures in Couchbase are similar in concept to data structures in Scala:

* *Map* is an iterable over a set of keys and values, like a https://docs.scala-lang.org/overviews/collections-2.13/maps.html[Scala Map].
* *List* is is a finite immutable sequence.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's Buffer in Scala, and is mutable. It extends Scala's mutable.AbstractBuffer

Values can be placed in the beginning or end of a list, and can be accessed using numeric indexes.
// or can it ? https://docs.scala-lang.org/overviews/collections-2.13/concrete-immutable-collection-classes.html#lists
* *Queue* is a First In First Out (FIFO) sequence,
like a https://docs.scala-lang.org/overviews/collections-2.13/concrete-immutable-collection-classes.html#immutable-queues[Scala Immutable Queue].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best to link to the mutable version here too

* *Map* is an iterable over a set of keys and values, like a https://docs.scala-lang.org/overviews/collections-2.13/maps.html[Scala Map].
* *List* is is a finite immutable sequence.
Values can be placed in the beginning or end of a list, and can be accessed using numeric indexes.
// or can it ? https://docs.scala-lang.org/overviews/collections-2.13/concrete-immutable-collection-classes.html#lists
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes random access is allowed

Data structures in Couchbase are similar in concept to data structures in Scala:

* *Map* is an iterable over a set of keys and values, like a https://docs.scala-lang.org/overviews/collections-2.13/maps.html[Scala Map].
* *List* is is a finite immutable sequence.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"is is"

Using the data structures API may help your application in two ways:

* *Simplicity*: Data structures provide high level operations by which you can deal with documents as if they were container data structures.
Adding an item to a dictionary is expressed as `MapAdd`, rather than retrieving the entire document, modifying it locally, and then saving it back to the server.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MapAdd -> map.apply() maybe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants