Skip to content

Commit

Permalink
Merge pull request quarkusio#6958 from machi1990/docs/review-mongo-pa…
Browse files Browse the repository at this point in the history
…nache-project-creation-command

change resource name to PersonResource to align docs with Mongo Panache quickstarts
  • Loading branch information
machi1990 authored Feb 3, 2020
2 parents 4cc69f1 + 202be72 commit 40079ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/src/main/asciidoc/mongodb-panache.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ First, we need a new project. Create a new project with the following command:
mvn io.quarkus:quarkus-maven-plugin:{quarkus-version}:create \
-DprojectGroupId=org.acme \
-DprojectArtifactId=mongodb-panache-quickstart \
-DclassName="org.acme.mongodb.panache.FruitResource" \
-Dpath="/fruits" \
-DclassName="org.acme.mongodb.panache.PersonResource" \
-Dpath="/persons" \
-Dextensions="resteasy-jsonb,mongodb-panache"
cd mongodb-panache-quickstart
----
Expand Down Expand Up @@ -320,7 +320,7 @@ Here are some query examples:

- `firstname = ?1 and status = ?2` will be mapped to `{'firstname': ?1, 'status': ?2}`
- `amount > ?1 and firstname != ?2` will be mapped to `{'amount': {'$gt': ?1}, 'firstname': {'$ne': ?2}}`
- `lastname like ?1` will be mapped to `{'lastname': {'$regex': ?1}}`. Be careful that this will be link:https://docs.mongodb.com/manual/reference/operator/query/regex/#op._S_regex[MongoDB regex] support and not SQL like pattern.
- `lastname like ?1` will be mapped to `{'lastname': {'$regex': ?1}}`. Be careful that this will be link:https://docs.mongodb.com/manual/reference/operator/query/regex/#op._S_regex[MongoDB regex] support and not SQL like pattern.
- `lastname is not null` will be mapped to `{'lastname':{'$exists': true}}`

We also handle some basic date type transformations: all fields of type `Date`, `LocalDate` or `LocalDateTime` will be mapped to the link:https://docs.mongodb.com/manual/reference/bson-types/#document-bson-type-date[BSON Date] using the `ISODate` type (UTC datetime).
Expand Down Expand Up @@ -598,7 +598,7 @@ That's all there is to it: with Panache, MongoDB has never looked so trim and ne
== Defining entities in external projects or jars

MongoDB with Panache relies on compile-time bytecode enhancements to your entities.
If you define your entities in the same project where you build your Quarkus application, everything will work fine.
If you define your entities in the same project where you build your Quarkus application, everything will work fine.
If the entities come from external projects or jars, you can make sure that your jar is treated like a Quarkus application library
by indexing it via Jandex, see link:cdi-reference#how-to-generate-a-jandex-index[How to Generate a Jandex Index] in the CDI guide.
This will allow Quarkus to index and enhance your entities as if they were inside the current project.

0 comments on commit 40079ee

Please sign in to comment.