Skip to content

provide documentation on how to create single element slice #4

@beoliver

Description

@beoliver

Excuse the code (working with Clojure)
As a slice can contain a single element.

(-> (new VPackBuilder)
    (.add ValueType/OBJECT)
    (.add "foo" "bar")
    .close
    .slice
    (.get "foo"))

#object[com.arangodb.velocypack.VPackSlice 0x2b9072bd "\"bar\""]

Is there a canonical way of creating a single element slice?

(-> (new VPackBuilder)
    (.add ValueType/ARRAY)
    (.add "bar")
    .close
    .slice
    (.get 0))

#object[com.arangodb.velocypack.VPackSlice 0x1eb0779a "\"bar\""]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions