File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/query Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,17 @@ public class Query {
32
32
33
33
private int limit ;
34
34
35
+
36
+ /**
37
+ * Static factory method to create a Query using the provided criteria
38
+ *
39
+ * @param key
40
+ * @return
41
+ */
42
+ public static Query query (Criteria critera ) {
43
+ return new Query (critera );
44
+ }
45
+
35
46
public Query () {
36
47
}
37
48
Original file line number Diff line number Diff line change @@ -30,6 +30,16 @@ public enum Position {
30
30
31
31
private HashMap <String , Object > criteria = new LinkedHashMap <String , Object >();
32
32
33
+ /**
34
+ * Static factory method to create an Update using the provided key
35
+ *
36
+ * @param key
37
+ * @return
38
+ */
39
+ public static Update update (String key , Object value ) {
40
+ return new Update ().set (key , value );
41
+ }
42
+
33
43
/**
34
44
* Update using the $set update modifier
35
45
*
@@ -41,7 +51,7 @@ public Update set(String key, Object value) {
41
51
criteria .put ("$set" , Collections .singletonMap (key , convertValueIfNecessary (value )));
42
52
return this ;
43
53
}
44
-
54
+
45
55
/**
46
56
* Update using the $unset update modifier
47
57
*
You can’t perform that action at this time.
0 commit comments