package com.google.code.morphia.query;

import java.util.List;

/** <p> 
 * 		A nicer interface to the update operations in monogodb. 
 *      All these operations happen at the server and can cause the server 
 *      and client version of the Entity to be different
 *  </p> 
 **/
public interface UpdateOperations<T> {
	/** sets a the field value */
	UpdateOperations<T> set(String fieldExpr, Object value);
	/** removes the field */
	UpdateOperations<T> unset(String fieldExpr);

	/** adds the value to an array field (on the server)*/
	UpdateOperations<T> add(String fieldExpr, Object value);
	UpdateOperations<T> add(String fieldExpr, Object value, boolean addDups);
	/** adds the values to an array field (on the server) */
	UpdateOperations<T> addAll(String fieldExpr, List<?> values, boolean addDups);
	
	/** removed the first value from the array (on the server)*/
	UpdateOperations<T> removeFirst(String fieldExpr);
	/** removed the last value from the array (on the server)*/
	UpdateOperations<T> removeLast(String fieldExpr);
	/** removed the value from the array field (on the server)*/
	UpdateOperations<T> removeAll(String fieldExpr, Object value);
	/** removed the values from the array field (on the server) */
	UpdateOperations<T> removeAll(String fieldExpr, List<?> values);

	/** decrements the value from the numeric field by 1 (on the server) */
	UpdateOperations<T> dec(String fieldExpr);
	/** increments the value from the numeric field by 1 (on the server) */
	UpdateOperations<T> inc(String fieldExpr);
	/** increments the value from the numeric field by value (negatives are allowed) (on the server) */
	UpdateOperations<T> inc(String fieldExpr, Number value);
}

@@ -329,10 +329,8 @@
 ets 
-a 
 the 
@@ -512,32 +512,16 @@
 ay field
- (on the server)
 */%0A%09Upda
@@ -686,33 +686,16 @@
 ay field
- (on the server) 
 */%0A%09Upda
@@ -778,25 +778,25 @@
 %0A%09/** remove
-d
+s
  the first v
@@ -814,32 +814,16 @@
 he array
- (on the server)
 */%0A%09Upda
@@ -876,25 +876,25 @@
 %0A%09/** remove
-d
+s
  the last va
@@ -911,32 +911,16 @@
 he array
- (on the server)
 */%0A%09Upda
@@ -968,33 +968,33 @@
 pr);%0A%09/** remove
-d
+s
  the value from 
@@ -1008,32 +1008,16 @@
 ay field
- (on the server)
 */%0A%09Upda
@@ -1086,17 +1086,17 @@
 * remove
-d
+s
  the val
@@ -1119,33 +1119,16 @@
 ay field
- (on the server) 
 */%0A%09Upda
@@ -1205,39 +1205,24 @@
 rements the 
-value from the 
 numeric fiel
@@ -1227,33 +1227,16 @@
 eld by 1
- (on the server) 
 */%0A%09Upda
@@ -1290,39 +1290,24 @@
 rements the 
-value from the 
 numeric fiel
@@ -1312,33 +1312,16 @@
 eld by 1
- (on the server) 
 */%0A%09Upda
@@ -1379,31 +1379,16 @@
 nts the 
-value from the 
 numeric 
@@ -1429,25 +1429,8 @@
 wed)
- (on the server) 
 */%0A%09

update javadocs