angular2-meteor
angular2-meteor copied to clipboard
._ensureIndex(..) is no longer working, is there a new API for this?
._ensureIndex(..) is no longer working when declaring a collection using the MeteorObservable.
Example _ensureIndex call:
// Create Unique Index for CollectionX
import { CollectionX } from '../both/collections/collectionx.collection';
CollectionX._ensureIndex( { rpId: 1, spId: 1 }, { unique: true } );
Example Collection Declaration:
import { MongoObservable } from 'meteor-rxjs';
import { Meteor } from 'meteor/meteor';
import { Party } from '../models/party.model';
export const Parties = new MongoObservable.Collection<Party>('parties');
I was able to get around this by connecting to the mongo db directly and calling the createindex() function
let collection = db.collection('collectionx');
collection.createIndex( { rpId: 1, spId: 1 }, { unique: true } );
The API in this case is to create a collection, set an index, and then:
export const Parties = new MongoObservable.Collection<Party>(collection);
Also please post issues related to meteor-rxjs to the associated repo.