exweiv / weiv-data Goto Github PK
View Code? Open in Web Editor NEWCustom API Library for Wix sites to connect MongoDB. Designed to easily switch from wix-data APIs.
Home Page: https://www.npmjs.com/package/@exweiv/weiv-data
Custom API Library for Wix sites to connect MongoDB. Designed to easily switch from wix-data APIs.
Home Page: https://www.npmjs.com/package/@exweiv/weiv-data
New issue
.After you submit your issue anyone can reply to you watch out for updates and please reply to any extra question that will be asked to you to get more info about the issue/topic you've created.
Some functions returns _ids in ObjectID type. We need to convert any ObjectId into string based id so it can be used. (Only for main _id field)
Currently we handle validations or other things (middlewares) manually by adding them just before the function start. We should create a more dynamic logic for middlewares and validators.
We should make error messages more clear and understandable by the users. Currently we have some general problems about errors in almost every single function of the library.
Collection Level:
We can rename consistentRead as readPreference and change value type to string to let library allow mongodb readPreference values.
We can also add useful and important options or all of them in data options. So users can use mongodb based options directly from weiv-data.
Wix app collections should be able to sync to the MongoDB collections easily, this can be done by exporting functions into backend files like data.js
and events.js
.
.query or other functions that reacts like that should be fixed
Currently we are using TypeDoc to automatically create the documentation based on JSDoc and .d.ts file/s. But in the future we are planning to switch to a better documentation system or create our own system.
When this happens we will also update some type safety features in our library to even provide better type safety with integrated TS types.
Any _id field that's in ObjectId type should be returned as string not in actual object version of it for easier use in frontend.
Currently system uses 5 min of cache time for MongoClients that's saved to cache via NodeCache. We can enable users to set custom cache rules for connections (MongoClient).
This can add more control to developers for cold starts.
Even if the library following some general/basic rules about security or other things it's not good enough, we should add some important but basic security features to library internally so users (clients) don't need to add their own basic validators or security checks.
Clients can still add functions that will run before the call to prevent security issues, or validate data that they are sending to weiv-data.
In some cases weiv-data returns string based ids (string version of ObjectIds) it should return ObjectId based ids always.
Instead of having single-reference fields we'll use multi-reference fields and if only one item needed the array will contain only one ObjectId. This will make development faster and easier and also faster operations in some cases.
Note: in MongoDB inserting a document also creates a collection automatically.
Currently it's not possible to use string based ids with this library (MongoDB supports string ids) because we are converting every single id to ObjectId even if it's string.
Usually it's better to use ObjectId especially in MongoDB but you may need different things with your ids.
We will add a feature that will let you choose between two id type
In this way we will convert the ids you sent or not based on the choosen option. And you'll be able to store string based ids like UUID.
When string is selected our library will use UUID to generate ids.
Instead of setting db name and collection name using two different strings. Use single string and split names with /
.
Example:
const { dbName, collectionName } = spliceNames(dynamicName: string);
_id values can be any type, basically whatever it is. We will only convert _ids (when returning data) if convertIds option is true. We will modify helpers to ignore non ObjectId _id's and only convert ObjectId type _id's from string to ObjectId.
In Wix (wix-data) this is possible via the UI of the Wix CMS dashboard (you can't configure extra settings with APIs, but can enable/disable this feature from the UI) but in weiv-data library this is not possible (not provided by the library but can be developed by the users).
Users will be able to:
In this way it will be possible to encrypt and decrypt data when reading or writing.
Extra info: MongoDB Atlas already encrypt data at rest. But it's always better to handle some part of the data (like passwords, passport numbers etc. PII) encryption manually when saving to disk other than MongoDB Atlas default encryption at rest.
Documentation should be updated including the README part with more clear setup flow and other details.
We don't have a feature to only return ObjectId from objectids and strings.
Check/test if query features are working as expected. Compare with wixData.query()
Create .insert() function.
Instead of creating three different secret for each connection URI we can use only one and store each URI inside of a JS object. This may reduce cold starts in the library.
All URIs stored as JSON in secret manager and named as WeivDataURIs
We get all three URI from that JSON value.
After we have test all features and fixed BUGs (if we find any) and update the documentation with new details/examples we will publish v4.0.1 and weiv-data will have it's own skeleton ready version for the first time.
skeleton ready version means a version that has all the main and required/optional functionality without any important BUG or problem.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.