This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This method will scan the provided object recursively looking for entries which match the test function. When one is found will return true. Sample Usage: | |
* ``` | |
* // Return those objects in the objArray with an entry equal to apple. | |
* objArr.filter(x, (o, k) => o[k] === 'apple'); | |
* ``` | |
* | |
* @param o The object to filter. | |
* @param fn The predicate function to test at each level of the object. | |
* @returns A boolean which when true indicates that the object meets the condition. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FilterQuery, UpdateQuery, QueryOptions, Model, model } from 'mongoose'; | |
/** | |
* As of mongoose 6.0.5 findOneAndUpdate does not handle the runValidators flag correctly. | |
* If you are running upsert in combination with this flag then the update will not get validated correctly. | |
* This is will fix that problem. | |
* @param filter The query which will be used to find the document. | |
* @param update The update which shall be applied. | |
* @param options The optional Query Options to extend the behavior. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start the old vagrant | |
$ vagrant init centos-6.3 | |
$ vagrant up | |
# You should see a message like: | |
# [default] The guest additions on this VM do not match the install version of | |
# VirtualBox! This may cause things such as forwarded ports, shared | |
# folders, and more to not work properly. If any of those things fail on | |
# this machine, please update the guest additions and repackage the | |
# box. |