$pop() {
    this._registerAtomic('$pop', 1);
    this._markModified();

    // only allow popping once
    if (this._popped) {
      return;
    }
    this._popped = true;

    return [].pop.call(this);
  }
Pops the array atomically at most one time per document `save()`.

#### NOTE:

_Calling this multiple times on an array before saving sends the same command as calling it once._
_This update is implemented using the MongoDB [$pop](https://www.mongodb.com/docs/manual/reference/operator/update/pop/) method which enforces this restriction._

     doc.array = [1,2,3];

     const popped = doc.array.$pop();
     console.log(popped); // 3
     console.log(doc.array); // [1,2]

     // no affect
     popped = doc.array.$pop();
     console.log(doc.array); // [1,2]

     doc.save(function (err) {
       if (err) return handleError(err);

       // we saved, now $pop works again
       popped = doc.array.$pop();
       console.log(popped); // 2
       console.log(doc.array); // [1]
     })

@api public
@method $pop
@memberOf MongooseArray
@instance
@see mongodb https://www.mongodb.com/docs/manual/reference/operator/update/pop/
@method $pop
@memberOf MongooseArray