algolia / algolia/mongoolia

TypeError: TagSchema.syncWithAlgolia is not a function

Open
#3 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
61
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Hey everyone,

I want to use mongoolia to sync my MongoDB with Algolia but am currently facing this bug when running the code:

`TypeError: TagSchema.syncWithAlgolia is not a function`

This is my code so far:

```
//meme schema
var meme = require('../app/model/meme');
var mongoose = require('mongoose');
const mongoolia = require('mongoolia').default;
var algoliasearch = require('algoliasearch');

const TagSchema = mongoose.Schema({
tagarray: { type: String, required: true, algoliaIndex: true },
});

TagSchema.plugin(mongoolia, {
appId: 'Qfdgdfgdf',
apiKey: 'd93fdgdfgffg',
indexName: 'test1'

})

TagSchema.syncWithAlgolia();

```

What am I doing wrong?

I was referred here by the algolia support team so hopefully, I get my problem solved here.

Thanks.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the error from the issue's schema snippet, starting at TagSchema.plugin(mongoolia, ...) and TagSchema.syncWithAlgolia(). Check the repository's documented plugin entry points and any available tests; done means the supported sync invocation is identified and the example no longer raises this TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.