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

Adding node modules in examples app #2615

Open
wants to merge 9 commits into
base: release-1.2
Choose a base branch
from

Conversation

tjzhang-BQ
Copy link
Collaborator

Issue link

This Pull Request is linked to issue (URL): [REPLACE ME]

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Destination branch is correct - main or release
  • Commits will be squashed upon merging.

@tjzhang-BQ tjzhang-BQ added node Node.js wrapper examples labels Nov 6, 2024
examples/node/json_example.ts Outdated Show resolved Hide resolved
examples/node/json_example.ts Outdated Show resolved Hide resolved
@avifenesh avifenesh added docs Documentation and removed examples labels Nov 8, 2024
TJ Zhang and others added 3 commits November 21, 2024 19:09
@cyip10 cyip10 marked this pull request as ready for review November 27, 2024 01:10
@cyip10 cyip10 requested a review from a team as a code owner November 27, 2024 01:10
Signed-off-by: Chloe Yip <[email protected]>
const query = "*=>[KNN 2 @VEC $query_vec]";

const vectorField_1: VectorField = {
type: "VECTOR",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type is a default field, there is no need to pass this. Is it working without passing this field?

export type VectorField = BaseField & {
    /** Field identifier */
    type: "VECTOR";
    /** Additional attributes to be passed with the vector field after the algorithm name. */
    attributes: VectorFieldAttributesFlat | VectorFieldAttributesHnsw;
};

"@valkey/valkey-glide": "latest",
"@types/node": "^20.4.8"
"@types/node": "^20.4.8",
"@valkey/valkey-glide": "../../node"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider adding "uuid" as a dependency, as it is used in vector_search_example.ts

Comment on lines +43 to +45
function setConsoleLogger() {
Logger.setLoggerConfig("warn");
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate with Logger.setLoggerConfig("warn", "glide.log");?

Comment on lines +4 to +5
import { Decoder, GlideClient, GlideClusterClient, GlideFt, FtSearchOptions,
FtSearchReturnType, Logger, VectorField} from "@valkey/valkey-glide";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider run linter command npx prettier -w . under example/node to keep consistency with other code in the repo, like the format of this import section, as linter is not enforced on example code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation node Node.js wrapper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants