== Json Pointers

Vert.x provides an implementation of <a href="https://tools.ietf.org/html/rfc6901">Json Pointers from RFC6901</a>.
You can use pointers both for querying and for writing. You can build your `link:../../jsdoc/module-vertx-js_json_pointer-JsonPointer.html[JsonPointer]` using
a string, a URI or manually appending paths:

[source,java]
----
var JsonPointer = require("vertx-js/json_pointer");
// Build a pointer from a string
var pointer1 = JsonPointer.from("/hello/world");
// Build a pointer manually
var pointer2 = JsonPointer.create().append("hello").append("world");

----

After instantiating your pointer, use `link:../../jsdoc/module-vertx-js_json_pointer-JsonPointer.html#queryJson[queryJson]` to query
a JSON value. You can update a Json Value using `link:../../jsdoc/module-vertx-js_json_pointer-JsonPointer.html#writeJson[writeJson]`:

[source,java]
----
// Query a JsonObject
var result1 = objectPointer.queryJson(jsonObject);
// Query a JsonArray
var result2 = arrayPointer.queryJson(jsonArray);
// Write starting from a JsonObject
objectPointer.writeJson(jsonObject, "new element");
// Write starting from a JsonObject
arrayPointer.writeJson(jsonArray, "new element");

----

You can use Vert.x Json Pointer with any object model by providing a custom implementation of `link:../../jsdoc/module-vertx-js_json_pointer_iterator-JsonPointerIterator.html[JsonPointerIterator]`