|
|
|
@ -125,7 +125,6 @@ public class Field { |
|
|
|
* @since 3.1 |
|
|
|
* @since 3.1 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Field include(String... fields) { |
|
|
|
public Field include(String... fields) { |
|
|
|
|
|
|
|
|
|
|
|
return include(Arrays.asList(fields)); |
|
|
|
return include(Arrays.asList(fields)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -134,15 +133,13 @@ public class Field { |
|
|
|
* |
|
|
|
* |
|
|
|
* @param fields the document field names to be included. |
|
|
|
* @param fields the document field names to be included. |
|
|
|
* @return {@code this} field projection instance. |
|
|
|
* @return {@code this} field projection instance. |
|
|
|
|
|
|
|
* @since 4.4 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Field include(Collection<String> fields) { |
|
|
|
public Field include(Collection<String> fields) { |
|
|
|
|
|
|
|
|
|
|
|
Assert.notNull(fields, "Keys must not be null"); |
|
|
|
Assert.notNull(fields, "Keys must not be null"); |
|
|
|
|
|
|
|
|
|
|
|
for (String key : fields) { |
|
|
|
fields.forEach(this::include); |
|
|
|
criteria.put(key, 1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -169,7 +166,6 @@ public class Field { |
|
|
|
* @since 3.1 |
|
|
|
* @since 3.1 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Field exclude(String... fields) { |
|
|
|
public Field exclude(String... fields) { |
|
|
|
|
|
|
|
|
|
|
|
return exclude(Arrays.asList(fields)); |
|
|
|
return exclude(Arrays.asList(fields)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -178,15 +174,13 @@ public class Field { |
|
|
|
* |
|
|
|
* |
|
|
|
* @param fields the document field names to be excluded. |
|
|
|
* @param fields the document field names to be excluded. |
|
|
|
* @return {@code this} field projection instance. |
|
|
|
* @return {@code this} field projection instance. |
|
|
|
|
|
|
|
* @since 4.4 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Field exclude(Collection<String> fields) { |
|
|
|
public Field exclude(Collection<String> fields) { |
|
|
|
|
|
|
|
|
|
|
|
Assert.notNull(fields, "Keys must not be null"); |
|
|
|
Assert.notNull(fields, "Keys must not be null"); |
|
|
|
|
|
|
|
|
|
|
|
for (String key : fields) { |
|
|
|
fields.forEach(this::exclude); |
|
|
|
criteria.put(key, 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|