Sails-mongo: how to add the option for maxTime(ms) for all models find query - sails.js

I would like to add the option for maxTime(ms) for all models find queries, but I don't want to add them one by one in every where. Is there any easy way to implement this?

Related

How to figure out correct interfaces for a component in UML component diagrams?

I have a doubt about UML component diagrams interfaces. I have a search component in my system which is responsible for search some product from the database and return the search result to the user. I have drawn search component in 3 different ways as I understood. I want to know which way is the correct one and best in practice and why others are not correct.
In this case I thought search component provides a Search interface to other components like User and they use that Search interface to search. Also the user passes search parameters through that interface and get the result through that interface as well.
In this case I thought Search component provides Search interface and and User uses that interface to pass search params. And it fetch data from the database. Then User component uses Search result interface to get the search result.
In this scenario, I thought Search component need search params to search something. So, It requires Search params. Therefore, I added Search params required interface. After fetching data Search component provides that result. So, I've added provide interface named search result.
These are the ways I thought about this Search Component. I don't have a Idea which one is the correct one. Please explain which one is the correct one and why others are not correct.
Thanks!!!
Lollipops and sockets do not tell what goes in and out but who provides or needs the interface definitions. So, simply spoken, the first variant would be correct. The Search interface offers some search(...) operations which yield some result. And the data must be provided via the Data interface. The component's task would then be to implement a search on data according to these interfaces.
It would help you if you would place the «interfaces» near the socket/lollipop and draw dependency/realization accordingly. For example like this:

Use filter to find sub-element of table in database (DBeaver)

I'm currently trying to list all Triggers available in a PostgreSQL database, regardless of the tables, using the DBeaver GUI.
What I would like to get looks like this:
https://ibb.co/dJZXCo
A result displaying only the Triggers category would be enough, I just want to quickly identify where the triggers are in my base.
To do so, I've tried to use global filters on the base itself, but it only filters table names.
I don't know if I can configure search depth so it includes inner elements of tables; or if there is a dedicated syntax to process the Triggers category in tables; or if the solution doesn't have anything to do with filtering.
There might be a very simple solution, but I can't seem to find it.
Thank you!

IBM WebSphere commerce: Manually create, edit and delete Attributes

I'm maintaining an API to manage several IBM commerce data systems.
What I need is to create, edit or remove attributes, their values and their descriptions. Basically, I need to work using the ATTR, ATTR_DESC, ATTRVAL and ATTRVAL_DESC tables.
I thought there was an AttributeCreateCmd, but I couldn't find it. What I found was the AttributeValueAddCmd command, but it seems that it is not working (maybe I'm not using it correctly). I need to handle the attributes
among the attribute values.
I tried also with AttributeBean and AttributeDataBean, but it seems that that's not the stuff I need.
What I know is the model objects that I need to work with are Attr and AttrVal, but I don't know what *Cmd, *Bean or whatever I need to maintain that data.
Is there something that does exactly what I need?
Ok, so to manage the ATTR data manually, seems you have to use AttributeDictionaryMediator, but I was unable to use it.
Finally I implemented the commands to access the tables, to use them wherever I need them.

Displaying results of perform find in a portal

I have some global variables $$A, $$B, $$C and what to search within a table for these terms in fieldA, fieldB and fieldC (using Perform Find). How can I use the result of this Perform Find to display the results in a portal.
The implementation by my predecessor replaces a field fieldSEARCHwith 1 if it is in the Perform Find results and 0 otherwise, and then uses a portal filtered by this field. This seems a very dodgey way of doing it, not least becuase it means that multiple users will not be able to search at the same time!
Can you enhance the portal filter to filter against the variables themselves? Or you can perform the find, grab IDs of the found set, put them into a global field, and then use the field to construct the relationship. Global fields are multi-user safe.
The best way is not to do this at all, but use list views to perform searches. List views are naturally searchable and much more flexible than portals (you can easily sort them, omit arbitrary records, and so on). It's possible to repeat this functionality in portals, but it's way more complex. I mean, if there's some serious gain from using a portal, then it's doable, but if not, then the native way is obviously better.
List views are easier to search, as FileMaker still hasn't transitioned to the 21st century and insists on this model... Most users however want a Master-Detail view, like a mail app, and understandably so as it's more intuitive (i.e. produce a list view on one side, but clicking on it updates detail/fields in the middle).
If this is what you want, you may want to cast an eye at Modular FM, where someone has already done the hard work for you:
http://www.modularfilemaker.org/module/masterdetail-2-0/
HTH
Stam

drupal 6 - can i use one exposed views filter to search/filter several similar cck fields?

i have a decent understanding of configuring drupal and using modules for basic stuff, but just getting into module development and overriding functions and stuff due to my very basic understanding of php and mysql.
i have a custom content type ('books') and a 3 cck field for genres (primary, secondary, tertiary). i'd like a user to be able to filter a view of all books with one exposed multi-selectable 'genre' filter. that's where i'm stuck-- i understand how to have three exposed filters for the 3 genre 'weights' (primary, secondary, tertiary)--i want one filter that would allow users to select any or all of those weights.
is a custom search form my only option? was there a better way to set things up? would i have been better off using one cck field for 'genres' with multiple entries? i ruled this out because i thought it would be harder to determine the genre 'weight' (primary, secondary, tertiary).
thanks a million.
Think about what the meaning of genres to a book is. Taxonomy is just what you use for this kind of thing. There are several pros using the taxonomy rather than using CCK fields.
Taxonomy is meta data, CCK fields are not. This mean that the way the html is generated for taxonomy terms, it will help SE to understand that these genres are important and it will give you a free SEO
You can setup how genres should be selected in far more detail than a CCK field. Again since taxonomy is made for exactly this kind of thing. You can setup how users are presentated with the genre selection in various ways. You can predefine genres or let users enter their own as they like. You can make child-parent relation ships and more
It's easier and more lightweight to use taxonomy than CCK fields.
If there only is 1 or 2 genre inputted you wont have to have empty CCK fields.
probably more that I can't think of right now
Using taxonomy you can pretty easily make a search with views, where you make it possible for users to select genres using a multiple select list. You can decide if you require all terms or only one of them. Simply put you should really use taxonomy, it should solve all of your problems, if not, you should still use it and try to solve the problems you could get using taxonomy instead of CCK fields.
Jergason has a good point saying that taxonomy would probably be a good fit for your fields. However this wouldn't solve your problem of weighted genres.
A possible (though hacky) solution would be to have a fourth field which combined the values of the other three which is only set when a node is saved. This field could then be used for searching.
The non hacky solution is to write your own views filter but this is very advanced.
There may be a way to do this with views out of the box it is flexible, hopefully someone else knows of an easier non hacky solution.