0
votes

I get a 403 forbidden when querying my database on Cloudant, with the following error: "temp views are disabled on Cloudant".

Can you help me rewrite the query to avoid this please ?

Thanks

.factory('usersDatabaseRemote', [
    'pouchDB',
    function (pouchDB) {
        'use strict';

        var usersDatabaseRemote = pouchDB('https://id:[email protected]/board_users');

        return usersDatabaseRemote;
    }
])

and :

           usersDatabaseRemote.query(mapByEmail, {
                key: email,
                include_docs: true
            }).then(function (result) {

                if (!result.rows.length) { //email doesn't exist in DB
                    return callback(false);
                }
                if (result.rows.length === 1) {
                    return callback(result);
                }
                console.log("problem : several docs in the DB with same email, run a duplicate check on the DB");
                return callback(result);
            });
1

1 Answers

0
votes

Temporary views were dropped in CouchDB 2.0 and in Cloudant because they were determined to be too big of a source of user error and therefore not worth maintaining. They are slow and people tended to abuse them to create slow indexes.