diff --git a/.gitignore b/.gitignore index ad8bc6af3..3c3324c0e 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,10 @@ doc/framework dead_links.json # Cypress debug -doc/6/getting-started/.react/cypress/screenshots -doc/6/getting-started/.react/cypress/videos -doc/6/getting-started/.vuejs/cypress/screenshots -doc/6/getting-started/.vuejs/cypress/videos +doc/7/getting-started/.react/cypress/screenshots +doc/7/getting-started/.react/cypress/videos +doc/7/getting-started/.vuejs/cypress/screenshots +doc/7/getting-started/.vuejs/cypress/videos + +# Debug snippets +test-*.js \ No newline at end of file diff --git a/doc/7/getting-started/react-native/index.md b/doc/7/getting-started/react-native/index.md index 7c635c79f..4d8d9ea82 100644 --- a/doc/7/getting-started/react-native/index.md +++ b/doc/7/getting-started/react-native/index.md @@ -16,7 +16,7 @@ This section deals with **Kuzzle V2** (+ **Javascript SDK 7**) and **React Nativ - **Node.js** >= 12.0.0 ([install here](https://nodejs.org/en/download/)) - **Running Kuzzle V2 Stack** ([instructions here](/core/2/guides/getting-started/running-kuzzle)) -- **Expo CLI** ([install here](https://docs.expo.io/versions/v36.0.0/get-started/installation/)) +- **Expo CLI** ([install here](https://docs.expo.io/get-started/installation)) "[Expo](https://docs.expo.io/versions/latest/) is a framework and a platform for universal React applications. It is a set of tools and services built around React Native and native platforms that help you develop, build, deploy, and quickly iterate on iOS, Android, and web apps from the same JavaScript/TypeScript codebase." diff --git a/src/controllers/Collection.js b/src/controllers/Collection.js index c7bc36456..471f1c6ec 100644 --- a/src/controllers/Collection.js +++ b/src/controllers/Collection.js @@ -50,11 +50,14 @@ class CollectionController extends BaseController { } getMapping (index, collection, options = {}) { - return this.query({ + const request = { index, collection, - action: 'getMapping' - }, options) + action: 'getMapping', + includeKuzzleMeta: options.includeKuzzleMeta || false + }; + + return this.query(request, options) .then(response => response.result); } diff --git a/test-js.js b/test-js.js deleted file mode 100644 index 900a76a13..000000000 --- a/test-js.js +++ /dev/null @@ -1,38 +0,0 @@ -class BaseHook { - constructor (event, filters) { - - } - - async action () { - - } -} - -backend.registerHook({ - event: 'generic:document:beforeWrite', - action: request => request, - filters: [ - { - exists: 'body.clientId' - }, - { - equals: { 'input.resource.index': 'omniscient' } - } - ] -}) - -this.hooks = { - 'generic:document:beforeWrite': { - action: () => {}, - filters: [ - { - // filter for event first arg - exists: 'body.clientId' - }, - { - // filter for event second arg - equals: { 'input.resource.index': 'omniscient' } - } - ] - } -}; diff --git a/test-sdk.js b/test-sdk.js deleted file mode 100644 index f785fe74a..000000000 --- a/test-sdk.js +++ /dev/null @@ -1,25 +0,0 @@ -const { Kuzzle, Http } = require('./index'); - -const kuzzle = new Kuzzle(new Http('localhost')) - -kuzzle.on('networkError', console.error); - -const run = async () => { - await kuzzle.connect() - - const result = await kuzzle.document.search('nyc-open-data', 'yellow-taxi', { - query: { - range: { - age: { - lte: 8, - gte: 5 - } - } - } - }); - - // Documents with age between 5 and 8 - console.log(result.hits); -}; - -run().catch(error => console.log(error)); diff --git a/test/controllers/collection.test.js b/test/controllers/collection.test.js index 7e9e70f1b..9bfd4e27c 100644 --- a/test/controllers/collection.test.js +++ b/test/controllers/collection.test.js @@ -131,6 +131,8 @@ describe('Collection Controller', () => { } } }); + options.includeKuzzleMeta = true; + return kuzzle.collection.getMapping('index', 'collection', options) .then(res => { @@ -140,7 +142,8 @@ describe('Collection Controller', () => { controller: 'collection', action: 'getMapping', index: 'index', - collection: 'collection' + collection: 'collection', + includeKuzzleMeta: true }, options); should(res).match({