Closed Celelibi closed 3 years ago
Mongo extension is not supported in phalcon for php 7. Try incubator MongoCollection class.
Yeah, I know. But it's easier to use an adapter for mongo than using a development version of Phalcon. And more generally, this is a non-conformance to the mongo API, even if is usually silentely ignored.
It seems to me ["w": 1]
can fix the issue
But as i told you @Celelibi collection class in phalcon 3 is only for php 5.x, not php 7.
Yea, but PHP 5.6 is LTS and 7.0 not. So we will support php5 until 2019 (for Phalcon 3)
Yea i know this. Just if he wants to his mongo with php 7 he needs to use class from incubator.
Related to #13697
Since version 4.0 Mongo is separate composer package - https://github.com/phalcon/incubator-mongodb
Closing.
Expected and Actual Behavior
When phalcon calls the save method on a collection, it passes the array argument:
["w": true]
in the filephalcon/mvc/collection.zep:912
. It should only pass an integer or a string as the documentation says. https://secure.php.net/manual/en/mongocollection.save.php https://secure.php.net/manual/en/mongo.writeconcerns.phpThis can be a problem when the Mongo API used isn't that of the legacy mongo PHP extension. For instance, this adapter between both mongo extensions API has a specific check and fail because of the non-conformance of phalcon to the mongo API. https://github.com/alcaeus/mongo-php-adapter/blob/master/lib/Alcaeus/MongoDbAdapter/Helper/WriteConcernConverter.php#L27
Details