Giter Site home page Giter Site logo

Comments (4)

nicolaiarocci avatar nicolaiarocci commented on July 23, 2024

Hello, extra lookups are read-only. See documentation:

'additional_lookup': RegEx defining and additional, custom read-only item endpoint.

Also, see the comment in in the example snippet:

# by default the standard item entry point is defined as
# '/people/<ObjectId>/'. We leave it untouched, and we also enable an
# additional read-only entry point. This way consumers can also perform
# GET requests at '/people/<lastname>/'.
'additional_lookup': {
    'url': '[\w]+',
    'field': 'lastname'
}

from eve.

tsileo avatar tsileo commented on July 23, 2024

Ok, Thanks,

But is there any way to use a different key other than _id as a primary key ?

I am working on a peewee extension to let me synchronize multiple SQLite databases (slave) to MongoDB (master) via Eve, and I would love not to store the MongoDB _id in each row of the SQLite database since I already have another unique key.

Thanks!

from eve.

nicolaiarocci avatar nicolaiarocci commented on July 23, 2024

You can change the default primary key by setting ID_FIELD. This will however set a different primary field for all endpoints. It would probably make sense to allow a endpoint-level id_field setting, which overrides the global.

from eve.

tsileo avatar tsileo commented on July 23, 2024

Thanks, I missed this setting in docs!

from eve.

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.