Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make discord-bot and netlify-functions-ecommerce work with tables #397

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

vkarpov15
Copy link
Collaborator

General idea:

  1. Disable _id and __v because of underscore property names issue
  2. Use insertMany() to create new documents and Model.updateOne() to update existing, as opposed to using save() and create(), because those rely on _id
  3. Use id instead of _id as unique identifier
  4. Comment out any logic that uses deleteMany(), dropCollection(), createCollection()
  5. Any nested properties are stored as JSON strings

Outstanding questions:

  1. Any workaround for lack of deleteOne() and deleteMany()? Hard to write tests without those.

@vkarpov15 vkarpov15 requested a review from a team as a code owner August 13, 2024 17:23
@vkarpov15
Copy link
Collaborator Author

Current outstanding issues:

  1. addIndex not handling camelCased names (addIndex seems to fail on names with uppercase (missing double quotes)? data-api#1404)
  2. $in support for Mongoose populate (Add support for $in for API Tables  data-api#1415)
  3. Sorting in find()
  4. skip

@vkarpov15
Copy link
Collaborator Author

In ae819af, I showed that Mongoose studio's basic functionality of displaying documents works with tables as well.

image

The missing features are:

  1. estimatedDocumentCount()
  2. countDocuments()

I worked around this limitation using the following code:

  const numDocuments =
    await Model.find(filter).then(docs => docs.length);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant