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

Execute raw NoSQL queries (e.g. MongoDB) #3342

Closed
4 of 6 tasks
bajtos opened this issue Jul 12, 2019 · 2 comments
Closed
4 of 6 tasks

Execute raw NoSQL queries (e.g. MongoDB) #3342

bajtos opened this issue Jul 12, 2019 · 2 comments
Assignees
Labels
db:MongoDB Topics specific to MongoDB feature Repository Issues related to @loopback/repository package stale user request

Comments

@bajtos
Copy link
Member

bajtos commented Jul 12, 2019

Suggestion

As I wrote in #2807 (comment), it is possible to execute raw SQL queries using the recently introduced Repository method execute, see #2681. This works great for SQL connectors.

Unfortunately, this method does not work for MongoDB and possibly for other NoSQL connectors that require more than just a command string and args array.

We need to find a way how to improve LB4 API, MongoDB connector API or both, to make it easy to execute raw MongoDB commands.

Related code:

Use Cases

Examples

const result = dataSource.execute('MyCollection', 'aggregate', [
    {
        $lookup:{
            .....   
        }
    },
    {   $unwind:"$data" },
    {
        $match:{
            ...
        }
    },
    {
        $lookup:{
            ... 
        }
    },
    {   $unwind:"$LoanRepayment" },
    { $project : { _id: 0} },
    { $out : "tempData" }
  ],
);

Acceptance criteria

@bajtos bajtos added feature Repository Issues related to @loopback/repository package db:MongoDB Topics specific to MongoDB labels Jul 12, 2019
@bajtos bajtos self-assigned this Jul 27, 2020
@dhmlau dhmlau added this to the Aug 2020 milestone Aug 4, 2020
@dhmlau dhmlau modified the milestones: Aug 2020, Sept 2020 Sep 1, 2020
@dhmlau dhmlau removed this from the Sept 2020 milestone Oct 1, 2020
@dhmlau dhmlau removed the 2020Q3 label Oct 1, 2020
@stale
Copy link

stale bot commented Jul 14, 2021

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

@stale stale bot added the stale label Jul 14, 2021
@stale
Copy link

stale bot commented Aug 13, 2021

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
db:MongoDB Topics specific to MongoDB feature Repository Issues related to @loopback/repository package stale user request
Projects
None yet
Development

No branches or pull requests

2 participants