appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.33k stars 3.72k forks source link

[Bug]-[2800]:BinData from MongoDB is not recognized #12404

Open ghost opened 2 years ago

ghost commented 2 years ago

Is there an existing issue for this?

Description

When I query MongoDB from Appsmith and try to use BinData the editor does not recognize the function.

Photo provided by discord user Fouad#2407:

image

I expect BinData to work as intended inside of MongoDB queries.

Steps To Reproduce

  1. Create a new Appsmith project.
  2. Add a MongoDB data source.
  3. Use new BinData() during the query.
  4. Observe that the function is not recognized.

Public Sample App

No response

Version

Cloud 1.6.17

MarabiFouad commented 2 years ago

I want to build a list of _id objects inside Or operator array based on selected rows in the table.

Nikhil-Nandagopal commented 2 years ago

@MarabiFouad BinData should be a string here "new BinData(${row._primary_key})"

MarabiFouad commented 2 years ago

{ "update": "orders", "updates": [ { "q": { _id:{ $in:[\"new BinData(03,\"aCpgBChCHUC1pxBlmRmNsQ==\")\",\"new BinData(03,\"57odwItZ5ka3AqybWRCkXw==\")\"] } }, "u": { "$set": { "Comment.Status": 2 } }, "multi": true } ] }

I still have an issue above code is the evaluated code but it is string and does not work

MarabiFouad commented 2 years ago

$in:["new BinData(03,"aCpgBChCHUC1pxBlmRmNsQ==")","new BinData(03,"57odwItZ5ka3AqybWRCkXw==")"] It should look like below $in:[new BinData(03,"aCpgBChCHUC1pxBlmRmNsQ=="),new BinData(03,"57odwItZ5ka3AqybWRCkXw==")]

sumitsum commented 2 years ago

Re-opening this issue since the user has reported that their issue is not resolved.

rohan-arthur commented 2 years ago

mongo 6m usage: 700 assume 50% requirement: 350

ajinkyakulkarni commented 2 years ago

Stats

Stat Values
Reach 350
Effort (months) 0.25