Giter VIP home page Giter VIP logo

Comments (3)

jannyHou avatar jannyHou commented on September 25, 2024

@htammen do you still run into same error? Could you provide the filter you used? Thanks. We have a bunch of test cases for $regex and they all pass.

from loopback-connector-cloudant.

b-admike avatar b-admike commented on September 25, 2024

Steps to verify:

  • create basic LB app with model model1 connected to cloudant datasource.
  • create following boot script following docs here:
'use strict';
module.exports = function(app) {
  var myDs = app.datasources.cldntlocal;
  function createMymodel() {
    myDs.automigrate('model1', function(err) {
      if (err)
        console.error('failed to migrate model-1 ', err);
      else {
        console.log('model created');
        insertModel();
      }
    });
  };
  function insertModel() {
    var myModel = app.models.model1;
    var testModel = {};
    testModel.foo = '123456789';
    var testModel2 = {foo: 'abcdefgh'};
    myModel.create([testModel, testModel2], function(err) {
      if (err)
        console.log('Insert failed ', err);
      else
        console.log('insert successful');
      myModel.find({where: {foo: {regexp: '^a'}}}, function(err, res) {
        if (err)
          console.log('find failed ', err);
        else
        console.log('find matching regexp: ', res);
      });
    });
  };
  myDs.once('connected', createMymodel);
};

results:

| => node .
Web server listening at: http://0.0.0.0:3000
Browse your REST API at http://0.0.0.0:3000/explorer
model created
insert successful
find only results:  [ { _rev: '1-b14a0f9ea27028f1d5484da94d79a32d',
    foo: 'abcdefgh',
    id: '22d0f5a08ddaef4e34d8cacdf2014b9f' } ]
^C

from loopback-connector-cloudant.

b-admike avatar b-admike commented on September 25, 2024

connect to https://github.com/strongloop-internal/scrum-apex/issues/240

from loopback-connector-cloudant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.