This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This is based on a fuzzy search video of a lecture by John L. Page. I am implementing | |
// a version for 5.8M records in Mongo for a Laravel PHP app. This is working and should | |
// port to laravel-mongodb using the "raw" method. Not sure if we could do the same thing | |
// in Eloquent but it shouldn't matter (would only make it look cleaner!) | |
$m = new \MongoDB\Driver\Manager('mongodb://127.0.0.1:27017'); | |
/*-- May not be using the proper terminology but it makes sense to me :) -- | |
* 1. Match _id's using $or conditional. This means we only want a result if one of values match. |