Switch MongoDB samples to records.

See #606.
This commit is contained in:
Mark Paluch
2021-04-28 15:18:59 +02:00
parent b44dc3dea1
commit e565f33872
69 changed files with 395 additions and 555 deletions

View File

@@ -74,7 +74,7 @@ public class DocumentValidation {
@Test
public void criteriaValidator() {
Validator validator = Validator.criteria( //
var validator = Validator.criteria( //
where("name").exists(true).ne(null).type(2) // non null String
.and("age").exists(true).ne(null).type(16).gte(0).lte(125)) // non null int between 0 and 125
;
@@ -116,7 +116,7 @@ public class DocumentValidation {
@Test
public void schemaValidator() {
Validator validator = Validator.schema(MongoJsonSchema.builder() //
var validator = Validator.schema(MongoJsonSchema.builder() //
.required("name", "age") //
.properties( //
string("name").minLength(1), //

View File

@@ -75,13 +75,13 @@ public class SchemaQuery {
@Test
public void criteriaValidator() {
Jedi luke = new Jedi("luke", "luke", "skywalker", 25);
Jedi yoda = new Jedi("yoda", "yoda", null, 900);
var luke = new Jedi("luke", "luke", "skywalker", 25);
var yoda = new Jedi("yoda", "yoda", null, 900);
mongoOps.save(luke);
mongoOps.save(yoda);
MongoJsonSchema schema = MongoJsonSchema.builder() //
var schema = MongoJsonSchema.builder() //
.required("name", "age") //
.properties( //
string("name").minLength(1), //