I'm trying to create a credits system specific to a single user within my website with wix but I can't seem to find any way of associating a variable or dataset with a single account that can take away credits when used. Its my first time using wix and Im not sure if this is possible.
Tried currentMember.getmember() for which there was no reference on the velo page.
Since your question is quite general, I will give you a general answer.
The basic idea is to create a collection with a field that references one of the member collections. That will associate each item in your collection with a specific user. Then you can keep track of credits using your collection.
Related
I have a firestore collection with a bunch of documents, each with plenty subfields. On a web page I need a list of a specific subfields from each document.
Currently I load the the entire database when you load the page and then loop through and get the wanted values. This uses way to many reads to get very little data.
Is there a way to solve this e.g. a autogenerated a collection that contains field from other collection in an array or something.
Many thanks in advance
Auto-creating such a subcollection with just the fields you need is a great way to reduce the bandwidth needed to load the data.
There is nothing built into Firestore to create those derived documents, but it's fairly easy to build something using Cloud Functions. Create a function that responds to a Firestore onWrite trigger, and write the subset of the data to its destination there. It's common to have a separate Cloud Function for each such use-case, and I regularly see projects with 100+ such functions.
I expect we'll also start seeing Firebase Extensions for this type of thing, but right now no-one seems to have built one.
I have a simple SharePoint list which consists of 2 columns, username and a Boolean Yes/No expression. It is used for users to acknowledge that they have read a document. I would like to create a button that would set all users Boolean expression back to ‘No’ when the document is amended/updated. Is there a way to do this?
I am very new to SharePoint and have not had a lot of experience with JavaScript. Thanks in advance for any help!
SharePoint does not provide a way to confirm that the user whether has read the document.
As a workaround, you could add a workflow to update the list value ,Users can start the workflow after reading the document.
Can you please explain two columns that you have added are part of the same document library , Or document & two columns in separate list.
If you have idea of JavaScript, then you can write CSOM Javascript code to implement the above scenario. you can also make use of SharePoint REST Calls.
If you have idea of C#, then you can write even receivers to clear off the boolean values based on Document State Changes.
In 10 Common Misconceptions about CouchDB, Joan Touzet is asked (30:16) if CouchDB will have a way to secure/validate reads on specific documents and/or specific fields of a document.
Joan says that if someone has access to the database, he/she can access all documents in that database.
So she says that there are a few ways to accomplish that:
(30:55) Cloudant was working on field level security access. Have they implemented it yet? Is it open-sourced?
(32:10) You should create separate document in a separate database.
(32:20) Filtered replications. She mentions that it slows 'things' down. She means that the filter slows the replication, correct?
Also, according to rcouch wiki (https://github.com/rcouch/rcouch/wiki/Validate-documents-on-read), it implements a validate_doc_read function (I haven't tested it, though). Does CouchDB has anything like it?
As far as I can see, the best approach is to model the database according to my problem (one database for this, another for that, one for this person, another for that person) and do filtered replications when necessary. Any suggestions?
I'm building a ticketing system website in Backbone.js. I now need to get a collection of messages belonging to one ticket. At first I thought of the obvious route '/ticket/:id'. Unfortunately, this already returns the ticket itself (creation date and which supporter was assigned to it). For this reason I need a different route.
A second logical option would be '/message/:id', but of course this refers to the individual message of a certain id.
So my question is: which route or url would you think is logical (keeping in mind the Backbonejs way of doing things) for getting all messages belonging to a certain ticket id? All tips are welcome!
If you try to model a collection of messages belongs to a ticket, you should use:
/tickets/:id/messages/
well, i am creating a network that allows users creating posts and like them.
Asking on stackoverflow i've understood how to structure my database:
A collection which includes a document for each post.
A collection which includes a document for each like, in each of these documents there is a reference to post is referenced to.
When i want to get ALL likes about a post i can query the like collection looking for the reference to that post.
And till here i am ok. But assuming i'll have millions documents in like collection, i wondered how could i query and search among them in not too long time.
And i was advised of ensureIndex, in this case, i have to ensureindex of the field which contains reference to a post.
But when do i have to create this index? is enough to create it once (for example when i set up my database) and it will be as default in mongodb or do i have to do it during application life-time? thank you
But assuming i'll have millions documents in like collection, i wondered how could i query and search among them in not too long time.
I assume you would most likely want to do a count on the likes as an example?
You can't, instead you use optimizations to combat this. A count on millions of rows might get a bit slow.
A typical scenario are counters in SQL techs that you use to amend the parent row with a sum figure of its children.
Same applies to MongoDB.
You would aggregate important data to the top.
If you require to actually query the likes to show some who have liked it then you limit those likes. Google+ and other networks tend to limit the amount of likes they show to about 1,000.
And i was advised of ensureIndex,
Adding indexes to a database does help with actually searching for documents.
But when do i have to create this index? is enough to create it once
Yes, MongoDB will manage the index itself. You only need to ensure it once.