Permalink
Commits on Mar 12, 2013
  1. @aheckmann

    release 3.6.0rc1

    aheckmann committed Mar 12, 2013
  2. @aheckmann
  3. @aheckmann

    fixed; $push $slice casting

    aheckmann committed Mar 12, 2013
  4. @aheckmann

    fixed; lean population

    should be lean() throughout all subdocs as well
    
    closes #1382
    aheckmann committed Mar 12, 2013
  5. @aheckmann

    docs; various schema items

    aheckmann committed Mar 12, 2013
  6. @aheckmann

    docs; document#populated()

    aheckmann committed Mar 12, 2013
  7. @aheckmann

    docs; document#populate()

    aheckmann committed Mar 12, 2013
  8. @aheckmann

    fixed; empty object mixed defaults

    Now interpreted as functions that return new empty objects.
    
    To restore old behavior (a shared object between all documents)
    set the "shared" option to true.
    
      new Schema({ data: { type: Mixed, default: {}, shared: true }})
    
    fixes #1380
    aheckmann committed Mar 12, 2013
  9. @aheckmann

    docs; shardKey

    aheckmann committed Mar 12, 2013
Commits on Mar 11, 2013
  1. @aheckmann

    docs; added examples of overriding `strict`

    in doc.set and Model.update
    aheckmann committed Mar 11, 2013
  2. @aheckmann

    benchmarks

    aheckmann committed Mar 11, 2013
  3. @aheckmann
  4. @aheckmann

    remove old TODO

    aheckmann committed Mar 11, 2013
  5. @aheckmann
  6. @aheckmann

    fixed; saving divergent populated arrays

    When a $set of an entire array or a $pop operation of that array
    is produced through document.save() and the array was populated
    using limit, skip, query condition, or deselection of the _id
    field, we now return an error. The view mongoose has of the array
    has diverged from the array in the database and these operations
    would have unknown consequences on that data.
    
    $pop:
    
      // database
      { _id: 1, array: [3,5,7,9] }
    
      // mongoose
      var query = Doc.findOne();
      query.populate({ path: 'array', match: { name: 'three' }})
      query.exec(function (err, doc) {
        console.log(doc.array) // [{ _id: 3, name: 'three' }]
        doc.$pop();
        console.log(doc.array) // []
        doc.save() // <== Error
      })
    
      This $pop removed the document with the _id of 3 from the
      array locally but when sent to the database would have
      removed the number 9 (since $pop removes the last element
      of the array). Instead, one could use doc.array.pull({ _id: 3 })
      or perform this update manually using doc.update(..);
    
    $set:
    
      // database
      { _id: 1, array: [9,3,7,5] }
    
      // mongoose
      var query = Doc.findOne();
      query.populate({ path: 'array', match: { _id: { $gt: 7 }}})
      query.exec(function (err, doc) {
        console.log(doc.array) // [{ _id: 9 }]
        doc.array.unshift({ _id: 2 })
        console.log(doc.array) // [{ _id: 2 }, { _id: 9 }]
        doc.save() // <== Error
      })
    
      The would result in a $set of the entire array (there is
      no equivalent atomic operator for `unshift`) which would
      overwrite the other un-matched elements in the array in
      the database. Use doc.update() instead.
    aheckmann committed Mar 11, 2013
  7. @aheckmann

    store all query options

    will use for divergent array checks
    aheckmann committed Mar 11, 2013
Commits on Mar 8, 2013
  1. @aheckmann
  2. @aheckmann

    remove dead code

    aheckmann committed Mar 8, 2013
  3. @aheckmann

    name private methods to something unusable

    any path starting with $ cannot be used in a schema
    aheckmann committed Mar 8, 2013
Commits on Mar 7, 2013
  1. @aheckmann

    use TypeError

    aheckmann committed Mar 6, 2013
  2. @aheckmann

    benchmark; make adjustable

    aheckmann committed Mar 7, 2013
  3. @aheckmann
  4. @aheckmann
  5. @aheckmann

    fixed; setting populated paths

    Setting a populated path (or manipulate a populated array) with
    works when the schema path does not have a `ref` declared and
    an adhoc model was used for population.
    
    relates to #570
    aheckmann committed Mar 5, 2013
Commits on Mar 5, 2013
  1. @aheckmann
Commits on Mar 4, 2013
  1. @aheckmann

    fixed; prohibit updating arrays selected with $elemMatch

    An $elemMatch projection only returns the elements of the array in the
    database that match the argument. While helpful when working with
    large arrays, it means we can no longer depend on any array elements
    position being accurate - manipulating these arrays with the
    mongoose helper methods would potentially result in incorrect array
    elements getting updated or even loss of array elements in the database.
    
    Attempting to update an array selected with an $elemMatch projection
    now returns an error that includes the array paths in violation.
    
    To update arrays selected with $elemMatch, manually use Model.update,
    Model.findByIdAndUpdate, or another method outside of document.save().
    
    closes #1334
    aheckmann committed Mar 4, 2013
  2. @aheckmann
  3. @aheckmann

    fixed; pull / set subdoc combination

    closes #1303
    aheckmann committed Mar 4, 2013
Commits on Mar 2, 2013
  1. @aheckmann

    test; cleanup

    aheckmann committed Mar 2, 2013
  2. @aheckmann

    docs; populate example

    aheckmann committed Mar 2, 2013
  3. @aheckmann

    test; make test-{short,long}

    aheckmann committed Mar 2, 2013
  4. @aheckmann

    fixed; multiple bg index creation

    In MongoDB < 2.4, multiple background indexes creation is not
    well supported. We now create indexes one-by-one.
    
    closes #1365
    aheckmann committed Mar 2, 2013
  5. @aheckmann

    test; added for #1365

    aheckmann committed Mar 2, 2013
Commits on Mar 1, 2013
  1. @aheckmann

    added; bufferCommands option

    when running with the drivers autoReconnect option
    disabled, mongoose buffers commands when the connection
    goes down, until you manually reconnect. to disable mongoose
    buffering commands while waiting for the connection to open
    or when the connection is down, set the bufferCommands schema
    option to false.
    aheckmann committed Mar 1, 2013
Commits on Feb 28, 2013
  1. @aheckmann