techfromsage / tripod-php

Object Graph Mapper for managing RDF data in Mongo
MIT License
29 stars 4 forks source link

Updated updateOne queries #118

Closed rgubby closed 7 years ago

rgubby commented 7 years ago

We are seeing some intermittent failures in both the app and in workers.

What is happening is that updateOne takes either an array or an object. If it's an array, it is supposed to be a filter - so ['match' => 'value']. If it's an object, it should be an ObjectId.

However - in Tripod, our _id fields are arrays - so validation on the updateOne function is ok - but it won't match. By changing it to be ['_id' => $generatedRow['_id']] we make sure the filter works as expected.

The update to MongoSearchProvider is where we are doing an insert where we should be using an upsert.