FeathersJS: How to move from mongodb to mongoose services?












0















I'm developing an app using FeathersJS, and I started the app using feathers-mongodb adapter. Now I'd like to move everything to mongoose because I think it will be easier to set the constraints I'm facing (compound indexes, schema validation, etc...). Is there any "automagic" way or at least a "some kind of easy" way to convert all my services from mongodb to mongoose?



Thank you!










share|improve this question

























  • I think there is no easy way to do this but still a lot easier compare to moving from sql to mongoose. In this case, you need to make sure that your mongoose schema will replicate the ones in your mongodb ( indexes, collection, document type, etc).

    – Jalil
    Nov 14 '18 at 0:12











  • Hello Jalil. Thank you for your answer, but I was referring to FeathersJS itself and not to any kind of "generic" way to change from one to the other. FeathersJS has a CLI that automatically generates the services for the specified adapter, and as it automatically generates the code for every service, I wanted to know if there was any kind of FeathersJS way to move from mongodb adapter FeathersJS service to mongoose adapter FeathersJS service. But anyway, thank you for your comment.

    – Jordi Blanch
    Nov 14 '18 at 8:54
















0















I'm developing an app using FeathersJS, and I started the app using feathers-mongodb adapter. Now I'd like to move everything to mongoose because I think it will be easier to set the constraints I'm facing (compound indexes, schema validation, etc...). Is there any "automagic" way or at least a "some kind of easy" way to convert all my services from mongodb to mongoose?



Thank you!










share|improve this question

























  • I think there is no easy way to do this but still a lot easier compare to moving from sql to mongoose. In this case, you need to make sure that your mongoose schema will replicate the ones in your mongodb ( indexes, collection, document type, etc).

    – Jalil
    Nov 14 '18 at 0:12











  • Hello Jalil. Thank you for your answer, but I was referring to FeathersJS itself and not to any kind of "generic" way to change from one to the other. FeathersJS has a CLI that automatically generates the services for the specified adapter, and as it automatically generates the code for every service, I wanted to know if there was any kind of FeathersJS way to move from mongodb adapter FeathersJS service to mongoose adapter FeathersJS service. But anyway, thank you for your comment.

    – Jordi Blanch
    Nov 14 '18 at 8:54














0












0








0








I'm developing an app using FeathersJS, and I started the app using feathers-mongodb adapter. Now I'd like to move everything to mongoose because I think it will be easier to set the constraints I'm facing (compound indexes, schema validation, etc...). Is there any "automagic" way or at least a "some kind of easy" way to convert all my services from mongodb to mongoose?



Thank you!










share|improve this question
















I'm developing an app using FeathersJS, and I started the app using feathers-mongodb adapter. Now I'd like to move everything to mongoose because I think it will be easier to set the constraints I'm facing (compound indexes, schema validation, etc...). Is there any "automagic" way or at least a "some kind of easy" way to convert all my services from mongodb to mongoose?



Thank you!







mongodb mongoose feathersjs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 8:46







Jordi Blanch

















asked Nov 13 '18 at 15:19









Jordi BlanchJordi Blanch

256




256













  • I think there is no easy way to do this but still a lot easier compare to moving from sql to mongoose. In this case, you need to make sure that your mongoose schema will replicate the ones in your mongodb ( indexes, collection, document type, etc).

    – Jalil
    Nov 14 '18 at 0:12











  • Hello Jalil. Thank you for your answer, but I was referring to FeathersJS itself and not to any kind of "generic" way to change from one to the other. FeathersJS has a CLI that automatically generates the services for the specified adapter, and as it automatically generates the code for every service, I wanted to know if there was any kind of FeathersJS way to move from mongodb adapter FeathersJS service to mongoose adapter FeathersJS service. But anyway, thank you for your comment.

    – Jordi Blanch
    Nov 14 '18 at 8:54



















  • I think there is no easy way to do this but still a lot easier compare to moving from sql to mongoose. In this case, you need to make sure that your mongoose schema will replicate the ones in your mongodb ( indexes, collection, document type, etc).

    – Jalil
    Nov 14 '18 at 0:12











  • Hello Jalil. Thank you for your answer, but I was referring to FeathersJS itself and not to any kind of "generic" way to change from one to the other. FeathersJS has a CLI that automatically generates the services for the specified adapter, and as it automatically generates the code for every service, I wanted to know if there was any kind of FeathersJS way to move from mongodb adapter FeathersJS service to mongoose adapter FeathersJS service. But anyway, thank you for your comment.

    – Jordi Blanch
    Nov 14 '18 at 8:54

















I think there is no easy way to do this but still a lot easier compare to moving from sql to mongoose. In this case, you need to make sure that your mongoose schema will replicate the ones in your mongodb ( indexes, collection, document type, etc).

– Jalil
Nov 14 '18 at 0:12





I think there is no easy way to do this but still a lot easier compare to moving from sql to mongoose. In this case, you need to make sure that your mongoose schema will replicate the ones in your mongodb ( indexes, collection, document type, etc).

– Jalil
Nov 14 '18 at 0:12













Hello Jalil. Thank you for your answer, but I was referring to FeathersJS itself and not to any kind of "generic" way to change from one to the other. FeathersJS has a CLI that automatically generates the services for the specified adapter, and as it automatically generates the code for every service, I wanted to know if there was any kind of FeathersJS way to move from mongodb adapter FeathersJS service to mongoose adapter FeathersJS service. But anyway, thank you for your comment.

– Jordi Blanch
Nov 14 '18 at 8:54





Hello Jalil. Thank you for your answer, but I was referring to FeathersJS itself and not to any kind of "generic" way to change from one to the other. FeathersJS has a CLI that automatically generates the services for the specified adapter, and as it automatically generates the code for every service, I wanted to know if there was any kind of FeathersJS way to move from mongodb adapter FeathersJS service to mongoose adapter FeathersJS service. But anyway, thank you for your comment.

– Jordi Blanch
Nov 14 '18 at 8:54












1 Answer
1






active

oldest

votes


















0














I would recommend migrating your project using the newer feathers-plus cli, and then you can switch between mongo/mongoose and any other adapter to your hearts content!



https://generator.feathers-plus.com/get-started/#generate-service



All you need to do is initially generate your service, and then you can modify the service/service.schema.js file, regenerate the service (or all of them, with feathers generate all, and then you will have updated mongo/mongoose models to work with - (service.mongo.js and service.mongoose.js respectively)



Edit: I should add that there's no automagic way to do this with the existing CLI - but the feathers-plus CLI will let you achieve what you're looking for.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53284132%2ffeathersjs-how-to-move-from-mongodb-to-mongoose-services%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I would recommend migrating your project using the newer feathers-plus cli, and then you can switch between mongo/mongoose and any other adapter to your hearts content!



    https://generator.feathers-plus.com/get-started/#generate-service



    All you need to do is initially generate your service, and then you can modify the service/service.schema.js file, regenerate the service (or all of them, with feathers generate all, and then you will have updated mongo/mongoose models to work with - (service.mongo.js and service.mongoose.js respectively)



    Edit: I should add that there's no automagic way to do this with the existing CLI - but the feathers-plus CLI will let you achieve what you're looking for.






    share|improve this answer




























      0














      I would recommend migrating your project using the newer feathers-plus cli, and then you can switch between mongo/mongoose and any other adapter to your hearts content!



      https://generator.feathers-plus.com/get-started/#generate-service



      All you need to do is initially generate your service, and then you can modify the service/service.schema.js file, regenerate the service (or all of them, with feathers generate all, and then you will have updated mongo/mongoose models to work with - (service.mongo.js and service.mongoose.js respectively)



      Edit: I should add that there's no automagic way to do this with the existing CLI - but the feathers-plus CLI will let you achieve what you're looking for.






      share|improve this answer


























        0












        0








        0







        I would recommend migrating your project using the newer feathers-plus cli, and then you can switch between mongo/mongoose and any other adapter to your hearts content!



        https://generator.feathers-plus.com/get-started/#generate-service



        All you need to do is initially generate your service, and then you can modify the service/service.schema.js file, regenerate the service (or all of them, with feathers generate all, and then you will have updated mongo/mongoose models to work with - (service.mongo.js and service.mongoose.js respectively)



        Edit: I should add that there's no automagic way to do this with the existing CLI - but the feathers-plus CLI will let you achieve what you're looking for.






        share|improve this answer













        I would recommend migrating your project using the newer feathers-plus cli, and then you can switch between mongo/mongoose and any other adapter to your hearts content!



        https://generator.feathers-plus.com/get-started/#generate-service



        All you need to do is initially generate your service, and then you can modify the service/service.schema.js file, regenerate the service (or all of them, with feathers generate all, and then you will have updated mongo/mongoose models to work with - (service.mongo.js and service.mongoose.js respectively)



        Edit: I should add that there's no automagic way to do this with the existing CLI - but the feathers-plus CLI will let you achieve what you're looking for.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 16 '18 at 19:59









        WDMTechWDMTech

        12819




        12819






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53284132%2ffeathersjs-how-to-move-from-mongodb-to-mongoose-services%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Xamarin.iOS Cant Deploy on Iphone

            Glorious Revolution

            Dulmage-Mendelsohn matrix decomposition in Python