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

Improve pushData section (README.md) #722

Closed
Silver-birder opened this Issue Oct 1, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@Silver-birder

Silver-birder commented Oct 1, 2018

Do you want to request a feature or report a bug?

feature

What is the current behavior?

environment

⋊> ~/work npm -v
4.6.1
⋊> ~/work yarn -v
fish: Unknown command 'yarn'

install npm package

⋊> ~/work npm init 
⋊> ~/work npm install algoliasearch --save 
work@1.0.0 /Users/silver/work
└── algoliasearch@3.30.0

npm WARN work@1.0.0 No description
npm WARN work@1.0.0 No repository field.

do

⋊> ~/work cat index.js
var client = algoliasearch('****', '****'); # I use Search-Only API Key ...
var index = client.initIndex('contacts');

var contactsJSON = require('./contacts.json');
# https://github.com/algolia/datasets/blob/master/contacts/contacts.json

index.addObjects(contactsJSON, function(err, content) {
  if (err) {
    console.error(err);
  }
});

⋊> ~/work node index.js
AlgoliaSearchError: Not enough rights to add an object near line:1 column:332

I resolved if I use Admin API Key but not Search-Only API Key.

If the current behavior is a bug, please provide all the steps to reproduce and a minimal
JSFiddle example or a repository on GitHub that we can npm install
and npm start.

no bug.

What is the expected behavior?

Please comment that use Admin API Key on pushData section (here)

@Haroenv

This comment has been minimized.

Member

Haroenv commented Oct 1, 2018

Adding objects needs to be done with the admin API key, that should indeed be mentioned there.

Haroenv added a commit that referenced this issue Oct 1, 2018

@Haroenv Haroenv closed this in #723 Oct 1, 2018

Haroenv added a commit that referenced this issue Oct 1, 2018

docs(readme): clarify which API key to use (#723)
* docs(readme): clarify which API key to use

fixes #722

* Update README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment