use of com.bluenimble.platform.json.JsonObject in project serverless by bluenimble.
the class Find method main.
public static void main(String[] args) throws Exception {
String query = "{ where: { age: 34 } }";
Database db = new DatabaseServer().get();
List<DatabaseObject> employees = db.find("Employees", new JsonQuery(new JsonObject(query)), null);
for (DatabaseObject employee : employees) {
System.out.println(employee.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
}
use of com.bluenimble.platform.json.JsonObject in project serverless by bluenimble.
the class FindAll method main.
public static void main(String[] args) throws Exception {
String query = "{ }";
Database db = new DatabaseServer().get();
List<DatabaseObject> employees = db.find("Employees", new JsonQuery(new JsonObject(query)), null);
for (DatabaseObject employee : employees) {
System.out.println(employee.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
}
use of com.bluenimble.platform.json.JsonObject in project serverless by bluenimble.
the class FindLike method main.
public static void main(String[] args) throws Exception {
String query = "{ where: { name: { op: like, value: m } } }";
Database db = new DatabaseServer().get();
List<DatabaseObject> employees = db.find("Employees", new JsonQuery(new JsonObject(query)), null);
for (DatabaseObject employee : employees) {
System.out.println(employee.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
}
use of com.bluenimble.platform.json.JsonObject in project serverless by bluenimble.
the class FindNotLike method main.
public static void main(String[] args) throws Exception {
String query = "{ where: { name: { op: nlike, value: m } } }";
Database db = new DatabaseServer().get();
List<DatabaseObject> employees = db.find("Employees", new JsonQuery(new JsonObject(query)), null);
for (DatabaseObject employee : employees) {
System.out.println(employee.toJson(new DefaultDatabaseObjectSerializer(2, 2)));
}
}
use of com.bluenimble.platform.json.JsonObject in project serverless by bluenimble.
the class Create method main.
public static void main(String[] args) throws DatabaseException {
Database db = new DatabaseServer().get();
DatabaseObject employee = db.create("Employees");
JsonArray names = new JsonArray();
names.add(new JsonObject().set("number", "4098776623").set("weight", 40));
employee.set("name", "New-1");
employee.set("age", 27);
employee.set("active", true);
employee.set("salary", 48.50);
employee.set("names", names);
employee.save();
System.out.println(employee.toJson(null));
}
Aggregations