docs: function (target, field, arg) {                                                                      // 221
      if (target[field] === undefined)                                                                          // 222
        target[field] = [];                                                                                     // 223
      if (!(target[field] instanceof Array))                                                                    // 224
        throw MinimongoError("Cannot apply $push modifier to non-array");                                       // 225
                                                                                                                // 226
      if (!(arg && arg.$each)) {                                                                                // 227
        // Simple mode: not $each                                                                               // 228
        target[field].push(arg);                                                                                // 229
        return;                                                                                                 // 230
      }                                                                                                         // 231
                                                                                                                // 232
      // Fancy mode: $each (and maybe $slice and $sort and $position)                                           // 233
      var toPush = arg.$each;                                                                                   // 234
      if (!(toPush instanceof Array))                                                                           // 235
        throw MinimongoError("$each must be an array");                                                         // 236
                                                                                                                // 237
      // Parse $position                                                                                        // 238
      var position = undefined;                                                                                 // 239
      if ('$position' in arg) {                                                                                 // 240
        if (typeof arg.$position !== "number")                                                                  // 241
          throw MinimongoError("$position must be a numeric value");                                            // 242
        // XXX should check to make sure integer                                                                // 243
        if (arg.$position < 0)                                                                                  // 244
          throw MinimongoError("$position in $push must be zero or positive");                                  // 245
        position = arg.$position;                                                                               // 246
      }                                                                                                         // 247
                                                                                                                // 248
      // Parse $slice.                                                                                          // 249
      var slice = undefined;                                                                                    // 250
      if ('$slice' in arg) {                                                                                    // 251
        if (typeof arg.$slice !== "number")                                                                     // 252
          throw MinimongoError("$slice must be a numeric value");                                               // 253
        // XXX should check to make sure integer                                                                // 254
        if (arg.$slice > 0)                                                                                     // 255
          throw MinimongoError("$slice in $push must be zero or negative");                                     // 256
        slice = arg.$slice;                                                                                     // 257
      }                                                                                                         // 258
                                                                                                                // 259
      // Parse $sort.                                                                                           // 260
      var sortFunction = undefined;                                                                             // 261
      if (arg.$sort) {                                                                                          // 262
        if (slice === undefined)                                                                                // 263
          throw MinimongoError("$sort requires $slice to be present");                                          // 264
        // XXX this allows us to use a $sort whose value is an array, but that's                                // 265
        // actually an extension of the Node driver, so it won't work                                           // 266
        // server-side. Could be confusing!                                                                     // 267
        // XXX is it correct that we don't do geo-stuff here?                                                   // 268
        sortFunction = new Minimongo.Sorter(arg.$sort).getComparator();                                         // 269
        for (var i = 0; i < toPush.length; i++) {                                                               // 270
          if (LocalCollection._f._type(toPush[i]) !== 3) {                                                      // 271
            throw MinimongoError("$push like modifiers using $sort " +                                          // 272
                        "require all elements to be objects");                                                  // 273
          }                                                                                                     // 274
        }                                                                                                       // 275
      }                                                                                                         // 276
                                                                                                                // 277
      // Actually push.                                                                                         // 278
      if (position === undefined) {                                                                             // 279
        for (var j = 0; j < toPush.length; j++)                                                                 // 280
          target[field].push(toPush[j]);                                                                        // 281
      } else {                                                                                                  // 282
        var spliceArguments = [position, 0];                                                                    // 283
        for (var j = 0; j < toPush.length; j++)                                                                 // 284
          spliceArguments.push(toPush[j]);                                                                      // 285
        Array.prototype.splice.apply(target[field], spliceArguments);                                           // 286
      }                                                                                                         // 287
                                                                                                                // 288
      // Actually sort.                                                                                         // 289
      if (sortFunction)                                                                                         // 290
        target[field].sort(sortFunction);                                                                       // 291
                                                                                                                // 292
      // Actually slice.                                                                                        // 293
      if (slice !== undefined) {                                                                                // 294
        if (slice === 0)                                                                                        // 295
          target[field] = [];  // differs from Array.slice!                                                     // 296
        else                                                                                                    // 297
          target[field] = target[field].slice(slice);                                                           // 298
      }                                                                                                         // 299
    }