Giter Club home page Giter Club logo

sails-restricted-attributes's People

Contributors

achannarasappa avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

sails-restricted-attributes's Issues

Issue - RestrictedAttrService is not defined

Hi,
I executed your code.
I am working on a POC - for sails restricted attributes
(lets say we have 5 fields in a collection..and one query requires first 3 fields out of the 5
and the second query requires last 3 fields out of the 5 then toJson can satisfy either one of the requirement). Figuring out your code.
I gave this input and created one user

http://localhost:1337/lb4/api/user/create?name=foo&[email protected]&password=*****&age=20&warnings=2&access=1

I gave the input through the console :

  1. sails lift
  2. sails console
  3. user.findOnebyId():
    I am getting this error:
    Can you tell me how to define the RestrictedAttrService?

/home/soundarya/Downloads/manytomany/node_modules/sails-mongo/node_modules/mongodb/lib/mongodb/connection/base.js:246
throw message;
^
ReferenceError: RestrictedAttrService is not defined
at /home/soundarya/Downloads/manytomany/api/controllers/UserController.js:13:16
at returnResults (/home/soundarya/Downloads/manytomany/node_modules/waterline/lib/waterline/query/finders/basic.js:168:9)
at /home/soundarya/Downloads/manytomany/node_modules/waterline/lib/waterline/query/finders/basic.js:74:16
at /home/soundarya/Downloads/manytomany/node_modules/waterline/lib/waterline/query/finders/operations.js:82:7
at Object.async.each (/home/soundarya/Downloads/manytomany/node_modules/waterline/node_modules/async/lib/async.js:121:20)
at /home/soundarya/Downloads/manytomany/node_modules/waterline/lib/waterline/query/finders/operations.js:425:11
at /home/soundarya/Downloads/manytomany/node_modules/waterline/lib/waterline/query/finders/operations.js:564:5
at Object.async.each (/home/soundarya/Downloads/manytomany/node_modules/waterline/node_modules/async/lib/async.js:121:20)
at _buildChildOpts (/home/soundarya/Downloads/manytomany/node_modules/waterline/lib/waterline/query/finders/operations.js:453:9)
at _execChildOpts (/home/soundarya/Downloads/manytomany/node_modules/waterline/lib/waterline/query/finders/operations.js:421:8)
at /home/soundarya/Downloads/manytomany/node_modules/waterline/lib/waterline/query/finders/operations.js:80:10
at bound (/home/soundarya/Downloads/manytomany/node_modules/waterline/node_modules/lodash/dist/lodash.js:957:21)
at applyInOriginalCtx (/home/soundarya/Downloads/manytomany/node_modules/waterline/lib/waterline/utils/normalize.js:421:80)
at wrappedCallback (/home/soundarya/Downloads/manytomany/node_modules/waterline/lib/waterline/utils/normalize.js:320:18)
at callback.success (/home/soundarya/Downloads/manytomany/node_modules/waterline/node_modules/switchback/lib/normalize.js:33:31)
at _switch (/home/soundarya/Downloads/manytomany/node_modules/waterline/node_modules/switchback/lib/factory.js:48:28)

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.