Fix Aggregate Match Pointer (#4643)

This commit is contained in:
Diamond Lewis
2018-03-14 21:57:30 -05:00
committed by GitHub
parent 3acb3e7a9b
commit c36ef99368
3 changed files with 10 additions and 5 deletions

View File

@@ -567,7 +567,7 @@ export class MongoStorageAdapter implements StorageAdapter {
if (stage.$match) {
for (const field in stage.$match) {
if (schema.fields[field] && schema.fields[field].type === 'Pointer') {
const transformMatch = { [`_p_${field}`] : `${className}$${stage.$match[field]}` };
const transformMatch = { [`_p_${field}`] : `${schema.fields[field].targetClass}$${stage.$match[field]}` };
stage.$match = transformMatch;
}
if (field === 'objectId') {

View File

@@ -1,5 +1,6 @@
import PromiseRouter from '../PromiseRouter';
import * as middleware from '../middlewares';
import Parse from 'parse/node';
export class PurgeRouter extends PromiseRouter {