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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TypeScript interface for the new PipelineStage - Vector Search #14428

Closed
2 tasks done
jkorach opened this issue Mar 10, 2024 · 1 comment
Closed
2 tasks done

Add TypeScript interface for the new PipelineStage - Vector Search #14428

jkorach opened this issue Mar 10, 2024 · 1 comment
Labels
typescript Types or Types-test related issue / Pull Request
Milestone

Comments

@jkorach
Copy link
Contributor

jkorach commented Mar 10, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

馃殌 Feature Proposal

With MongoDB releasing the new vector search index & pipeline stage, Mongoose is missing this PiplineStage, which creates compilation error in TypeScript. The proposal is to add support for this new PipelineStage

Motivation

To maintain & support the typesafe aggregation pipeline in Mongoose.

Example

import mongoose from "mongoose";

const contentsSchema = new mongoose.Schema({
  embedding: {
    type: [Number],
  },
  title: String,
});
export const Contents = mongoose.model(
  "Contents",
  contentsSchema,
  "contents",
);

 const result = await Contents.aggregate([
    {
      $vectorSearch: {
        index: "title_vector_index",
        path: "embedding",
        filter: {someField: "value"}
        queryVector:[0.3455,......0.123],
        numCandidates: 200,
        limit: 10,
      },
    },
  ]);
@jkorach jkorach added enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature new feature This change adds new functionality, like a new method or class labels Mar 10, 2024
@jkorach
Copy link
Contributor Author

jkorach commented Mar 10, 2024

Just opened this PR in order to solve it

vkarpov15 added a commit that referenced this issue Mar 14, 2024
Add TypeScript interface for the new PipelineStage - Vector Search - solving issue #14428
@vkarpov15 vkarpov15 added this to the 8.2.2 milestone Mar 14, 2024
@vkarpov15 vkarpov15 added typescript Types or Types-test related issue / Pull Request and removed new feature This change adds new functionality, like a new method or class enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature labels Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

No branches or pull requests

2 participants