Comments (3)
Hi, the best SCHEMA example is https://github.com/totaljs/cms Have a look at ./controllers/manager.js which uses multiple schemas then check ./models/ folder for how the schemas are defined.
It's clearly much better example then any TODO app could ever be.
@carlos-duran the difference between $save and $workflow
As the name $save suggest it servers the purpose of saving document into DB, whereas $workflow can do anything you want, which means you can create a workflow for saving data too, so in a way you can say $save
is alternative for $workflow('save')
. To give You an example imagine following situation. A user fills in a register form on Your page and submits it then on the server You need to check if the user's email already exists in DB and if not then save the user data and send him an email confirmation of registration. Now in the code it would look like this:
//controller
F.route('/register', json_register, ['post', '*User']);
function json_register(){
var self = this;
self.body.$async(self.callback(), 1).$workflow('check.email').$save().$workflow('send.confirmation');
}
This gives you clear view of what's going on in the code.
Have a look at the cms I mentioned above. It's really great example.
from examples.
+1 👍 There need for this, a simple TODO app would be great..
from examples.
Thank you for the answer. I will see the cms source code 👍
Have a good day.
from examples.
Related Issues (20)
- remote-terminal 无法输入
- Can't set dynamic from/replyTo HOT 4
- [Nuxt-Middleware] Error "hot-update" when change .vue file. HOT 3
- I can't run ANY of the examples ... ? HOT 3
- Can we work with Swagger in total.js HOT 2
- Roles in authorization HOT 2
- How to Set action Body from outside HOT 2
- How to work with socket.io in total.js? HOT 1
- This script needs improvement. HOT 1
- angular 4 with server side render HOT 1
- next-js HOT 3
- Any examples of how to wrap self.$get(self, self.callback()) in controller? HOT 1
- bad url in documentation HOT 1
- Compile .scss freeze HOT 9
- the export of functions in business logic does not work HOT 5
- ReferenceError: MAIN is not defined HOT 2
- Failed to run examples/postgres: require(...).init is not a function HOT 1
- Session and roles HOT 2
- Totaljs with elasticsearch HOT 1
- TypeError: HTTP(...) is not a function TypeError: HTTP(...) is not a function HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from examples.