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

fix objectId encoding/decoding on json objects #90

Merged
merged 10 commits into from
Oct 17, 2016
Merged
4 changes: 4 additions & 0 deletions vertx-mongo-client/src/main/asciidoc/dataobjects.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ Get the document id that's upserted
+++
Set whether multi is enabled
+++
|[[returningNewDocument]]`returningNewDocument`|`Boolean`|
+++
Set whether new document property is enabled. Valid only on findOneAnd* methods.
+++
|[[upsert]]`upsert`|`Boolean`|
+++
Set whether upsert is enabled
Expand Down
20 changes: 15 additions & 5 deletions vertx-mongo-client/src/main/asciidoc/groovy/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ To use this project, add the following dependency to the _dependencies_ section
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-mongo-client</artifactId>
<version>3.4.0-SNAPSHOT</version>
<version>3.3.3</version>
</dependency>
----

* Gradle (in your `build.gradle` file):

[source,groovy,subs="+attributes"]
----
compile 'io.vertx:vertx-mongo-client:3.4.0-SNAPSHOT'
compile 'io.vertx:vertx-mongo-client:3.3.3'
----


Expand Down Expand Up @@ -279,7 +279,7 @@ mongoClient.update("books", query, update, { res ->
----

To specify if the update should upsert or update multiple documents, use `link:../../groovydoc/io/vertx/groovy/ext/mongo/MongoClient.html#updateWithOptions(java.lang.String,%20io.vertx.core.json.JsonObject,%20io.vertx.core.json.JsonObject,%20io.vertx.ext.mongo.UpdateOptions,%20io.vertx.core.Handler)[updateWithOptions]`
and pass in an instance of `link:../dataobjects.html#UpdateOptions[UpdateOptions]`.
and pass in an instance of `link:../../null/dataobjects.html#UpdateOptions[UpdateOptions]`.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why ../null?

Copy link
Contributor

Choose a reason for hiding this comment

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

groovy doc generation bug ? how does it look like with other languages ?

This has the following fields:

Expand Down Expand Up @@ -429,7 +429,7 @@ mongoClient.find("books", query, { res ->
The matching documents are returned as a list of json objects in the result handler.

To specify things like what fields to return, how many results to return, etc use `link:../../groovydoc/io/vertx/groovy/ext/mongo/MongoClient.html#findWithOptions(java.lang.String,%20io.vertx.core.json.JsonObject,%20io.vertx.ext.mongo.FindOptions,%20io.vertx.core.Handler)[findWithOptions]`
and pass in the an instance of `link:../dataobjects.html#FindOptions[FindOptions]`.
and pass in the an instance of `link:../../null/dataobjects.html#FindOptions[FindOptions]`.

This has the following fields:

Expand All @@ -446,9 +446,18 @@ def query = [
]

mongoClient.findBatch("book", query, { res ->

if (res.succeeded()) {

println(groovy.json.JsonOutput.toJson(res.result()))
if (res.result() == null) {

println("End of research")

} else {

println("Found doc: ${groovy.json.JsonOutput.toJson(res.result())}")

}

} else {

Expand All @@ -457,6 +466,7 @@ mongoClient.findBatch("book", query, { res ->
}
})


----

The matching documents are returned unitary in the result handler.
Expand Down
15 changes: 12 additions & 3 deletions vertx-mongo-client/src/main/asciidoc/java/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ To use this project, add the following dependency to the _dependencies_ section
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-mongo-client</artifactId>
<version>3.4.0-SNAPSHOT</version>
<version>3.3.3</version>
</dependency>
----

* Gradle (in your `build.gradle` file):

[source,groovy,subs="+attributes"]
----
compile 'io.vertx:vertx-mongo-client:3.4.0-SNAPSHOT'
compile 'io.vertx:vertx-mongo-client:3.3.3'
----


Expand Down Expand Up @@ -360,9 +360,18 @@ This has the following fields:
JsonObject query = new JsonObject().put("author", "J. R. R. Tolkien");

mongoClient.findBatch("book", query, res -> {

if (res.succeeded()) {

System.out.println(res.result().encodePrettily());
if (res.result() == null) {

System.out.println("End of research");

} else {

System.out.println("Found doc: " + res.result().encodePrettily());

}

} else {

Expand Down
20 changes: 15 additions & 5 deletions vertx-mongo-client/src/main/asciidoc/js/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ To use this project, add the following dependency to the _dependencies_ section
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-mongo-client</artifactId>
<version>3.4.0-SNAPSHOT</version>
<version>3.3.3</version>
</dependency>
----

* Gradle (in your `build.gradle` file):

[source,groovy,subs="+attributes"]
----
compile 'io.vertx:vertx-mongo-client:3.4.0-SNAPSHOT'
compile 'io.vertx:vertx-mongo-client:3.3.3'
----


Expand Down Expand Up @@ -279,7 +279,7 @@ mongoClient.update("books", query, update, function (res, res_err) {
----

To specify if the update should upsert or update multiple documents, use `link:../../jsdoc/module-vertx-mongo-js_mongo_client-MongoClient.html#updateWithOptions[updateWithOptions]`
and pass in an instance of `link:../dataobjects.html#UpdateOptions[UpdateOptions]`.
and pass in an instance of `link:../../null/dataobjects.html#UpdateOptions[UpdateOptions]`.

This has the following fields:

Expand Down Expand Up @@ -430,7 +430,7 @@ mongoClient.find("books", query, function (res, res_err) {
The matching documents are returned as a list of json objects in the result handler.

To specify things like what fields to return, how many results to return, etc use `link:../../jsdoc/module-vertx-mongo-js_mongo_client-MongoClient.html#findWithOptions[findWithOptions]`
and pass in the an instance of `link:../dataobjects.html#FindOptions[FindOptions]`.
and pass in the an instance of `link:../../null/dataobjects.html#FindOptions[FindOptions]`.

This has the following fields:

Expand All @@ -447,9 +447,18 @@ var query = {
};

mongoClient.findBatch("book", query, function (res, res_err) {

if (res_err == null) {

console.log(JSON.stringify(res));
if (res === null) {

console.log("End of research");

} else {

console.log("Found doc: " + JSON.stringify(res));

}

} else {

Expand All @@ -458,6 +467,7 @@ mongoClient.findBatch("book", query, function (res, res_err) {
}
});


----

The matching documents are returned unitary in the result handler.
Expand Down
20 changes: 15 additions & 5 deletions vertx-mongo-client/src/main/asciidoc/ruby/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ To use this project, add the following dependency to the _dependencies_ section
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-mongo-client</artifactId>
<version>3.4.0-SNAPSHOT</version>
<version>3.3.3</version>
</dependency>
----

* Gradle (in your `build.gradle` file):

[source,groovy,subs="+attributes"]
----
compile 'io.vertx:vertx-mongo-client:3.4.0-SNAPSHOT'
compile 'io.vertx:vertx-mongo-client:3.3.3'
----


Expand Down Expand Up @@ -279,7 +279,7 @@ mongoClient.update("books", query, update) { |res_err,res|
----

To specify if the update should upsert or update multiple documents, use `link:../../yardoc/VertxMongo/MongoClient.html#update_with_options-instance_method[updateWithOptions]`
and pass in an instance of `link:../dataobjects.html#UpdateOptions[UpdateOptions]`.
and pass in an instance of `link:../../null/dataobjects.html#UpdateOptions[UpdateOptions]`.

This has the following fields:

Expand Down Expand Up @@ -432,7 +432,7 @@ mongoClient.find("books", query) { |res_err,res|
The matching documents are returned as a list of json objects in the result handler.

To specify things like what fields to return, how many results to return, etc use `link:../../yardoc/VertxMongo/MongoClient.html#find_with_options-instance_method[findWithOptions]`
and pass in the an instance of `link:../dataobjects.html#FindOptions[FindOptions]`.
and pass in the an instance of `link:../../null/dataobjects.html#FindOptions[FindOptions]`.

This has the following fields:

Expand All @@ -450,9 +450,18 @@ query = {
}

mongoClient.find_batch("book", query) { |res_err,res|

if (res_err == nil)

puts JSON.generate(res)
if (res == nil)

puts "End of research"

else

puts "Found doc: #{JSON.generate(res)}"

end

else

Expand All @@ -461,6 +470,7 @@ mongoClient.find_batch("book", query) { |res_err,res|
end
}


----

The matching documents are returned unitary in the result handler.
Expand Down
Loading