Compatibility with mongoose 3.6.0