Code Monkey home page Code Monkey logo

Comments (4)

mdhanda avatar mdhanda commented on July 3, 2024 1

Looks like your suggestion is working and I was making an error putting it the right way. It confronted me while I was putting up the example.

const service = require('feathers-mongoose');
const hooks = require('feathers-hooks');

I was using
hooks.toObject({});
instead of
service.hooks.toObject({});

So, it works and feel free to close this issue.
Many thanks for your help.

from feathers-rest.

daffl avatar daffl commented on July 3, 2024

This looks like a Mongoose error. Can you try and see if it works with the toObject hook?

from feathers-rest.

mdhanda avatar mdhanda commented on July 3, 2024

Here is the output after applying the suggested hook:

 D:\Dev\workspace\WebstormProjects\ES6\angular2-esnext-starter\server\services\user\hooks\index.js:47
        hooks.toObject({}),
              ^

TypeError: hooks.toObject is not a function
    at Object.<anonymous> (D:\Dev\workspace\WebstormProjects\ES6\angular2-esnext-starter\server\services\user\hooks\index.js:47:15)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (D:\Dev\workspace\WebstormProjects\ES6\angular2-esnext-starter\server\services\user\index.js:5:15)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)

from feathers-rest.

daffl avatar daffl commented on July 3, 2024

Can you put up a breaking example to reproduce?

from feathers-rest.

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.