enricorotundo / jlpms

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Should we push "_id" into Algolia's index? #3

Open enricorotundo opened 5 years ago

enricorotundo commented 5 years ago

If we need to add "_id" to the list below so that is indexed by algolia we'd need to implement the changes below. https://github.com/enricorotundo/jlpms/blob/d98d186a41333057408b70c8d6d1c072d48a2e95/fetcher/fetcher.py#L55 On the other hand, "id" is already being indexed by both mongo and algolia, should we just use that?

Changes needed:

  1. change update_one with https://docs.mongodb.com/manual/reference/command/findAndModify/
  2. pass mongo's "_id" to algolia "objectID" (https://www.algolia.com/doc/api-reference/api-methods/add-objects/)
  3. redeploy lambda
gfornari commented 5 years ago

I think it's better to use the MongoDB's ObjectId, because more extensible. Once (maybe) we'll integrate other sources other than GitHub, we cannot rely on the GitHub id anymore.