         l.splice(i, 1)
         i -= 1
 
-  $push: (d, k, upd) -> # Adds an item to an array.
+  # Adds an item to an array.
+  $push: (d, k, upd) ->
     l = dotGet(d, k)
     # $each 	append multiple items for array updates.
     if upd.$each?

    return 0

u1 =
  # [fields]
  $inc: (d, k, upd) -> dotSet(d, k, upd + dotGet(d, k)) # Increments the value of the field by the specified amount.
  $rename: (d, k, upd) -> # Renames a field.
    dotSet(d, upd, dotGet(d, k))
    dotDel(d, k)
  $setOnInsert: (d, k, upd, insert) ->	# Sets the value of a field upon documentation creation during an upsert. Has no effect on update operations that modify existing documents.
    return unless insert
    dotSet(d, k, upd)
  $set: (d, k, upd) -> dotSet(d, k, upd) #Sets the value of a field in an existing document.
  $unset: (d, k, upd) -> dotDel(d, k) # Removes the specified field from an existing document.
  # [Array][operators]
  # TODO: $ 	Acts as a placeholder to update the first element that matches the query condition in an update.
  $addToSet: (d, k, upd) -> # Adds elements to an existing array only if they do not already exist in the set.
    l = dotGet(d, k)
    # $each 	append multiple items for array updates.
    if upd.$each?

    else
      l.push(upd) unless upd in l

  # Removes the first or last item of an array.
  $pop: (d, k, upd) ->
    l = dotGet(d, k)
    if upd < 0
      l.shift()
    else
      l.pop()

  # Removes multiple values from an array.
  $pullAll: (d, k, upd) ->
    l = dotGet(d, k)
    for i in [0...l.length]
      if l[i] in upd
        l.splice(i, 1)
        i -= 1

  # Removes items from an array that match a query statement.
  $pull: (d, k, upd) ->
    l = dotGet(d, k)
    q = Query(upd)
    for i in [0...l.length]
