Skip to content

MongoDB "find" tool not using the limit parameter #1491

@abdul0807

Description

@abdul0807

Prerequisites

  • I've searched the current open issues
  • I've updated to the latest version of Toolbox

Toolbox version

toolbox version 0.14.0

Environment

No response

Client

No response

Expected Behavior

Based on the below configuration:

tools:
  find_documents_in_collection:
    kind: mongodb-find
    source: mongodb-source
    description: >-
      Finds and lists multiple documents from the given collection.
      Use this for general searches or when you expect a list of results.
    database: xxxxxx
    collection: xxxxxx
    limit: 5

Only 5 records should be returned because the limit is 5.

Current Behavior

The limit parameter is not being applied to the MongoDB query.

Steps to reproduce?

  1. create a tools.yaml file to connect to MongoDB
  2. Use the "find tool". Sample configuration is shared below for reference:
tools:
  find_documents_in_collection:
    kind: mongodb-find
    source: mongodb-source
    description: >-
      Finds and lists multiple documents from the given collection.
      Use this for general searches or when you expect a list of results.
    database: xxxxxx
    collection: xxxxxx
    limit: 5
  1. The toolbox returns all the documents and does not respect the limit value

Additional Details

No response

Metadata

Metadata

Assignees

Labels

type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions